Skip to content

Commit

Permalink
Compile warnings fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Dec 26, 2019
1 parent cd5254b commit daa700b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public IDataTransferNode createNode() throws DBException
{
implType.checkObjectClass(IDataTransferNode.class);
try {
return implType.getObjectClass(IDataTransferNode.class).newInstance();
return implType.getObjectClass(IDataTransferNode.class).getDeclaredConstructor().newInstance();
} catch (Throwable e) {
throw new DBException("Can't create data transformer node", e);
}
Expand All @@ -125,7 +125,7 @@ public IDataTransferSettings createSettings() throws DBException
{
settingsType.checkObjectClass(IDataTransferSettings.class);
try {
return settingsType.getObjectClass(IDataTransferSettings.class).newInstance();
return settingsType.getObjectClass(IDataTransferSettings.class).getDeclaredConstructor().newInstance();
} catch (Throwable e) {
throw new DBException("Can't create node settings", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public GenericMetaModel getInstance() throws DBException {
throw new DBException("Can't create generic meta model instance '" + implType.getImplName() + "'");
}
try {
instance = implClass.newInstance();
instance = implClass.getDeclaredConstructor().newInstance();
} catch (Throwable e) {
throw new DBException("Can't instantiate meta model", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.jkiss.dbeaver.ext.mysql.tools;

import org.eclipse.jface.wizard.IWizardPage;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.tasks.MySQLScriptExecuteSettings;
import org.jkiss.dbeaver.ext.mysql.tasks.MySQLTasks;
Expand All @@ -32,7 +33,7 @@

class MySQLScriptExecuteWizard extends AbstractScriptExecuteWizard<MySQLScriptExecuteSettings, MySQLCatalog, MySQLCatalog> {

private MySQLScriptExecuteWizardPageSettings mainPage = new MySQLScriptExecuteWizardPageSettings(this);
private MySQLScriptExecuteWizardPageSettings settingsPage = new MySQLScriptExecuteWizardPageSettings(this);

MySQLScriptExecuteWizard(MySQLCatalog catalog, boolean isImport) {
super(Collections.singleton(catalog), isImport ? MySQLUIMessages.tools_script_execute_wizard_db_import : MySQLUIMessages.tools_script_execute_wizard_execute_script);
Expand All @@ -51,7 +52,7 @@ public String getTaskTypeId() {

@Override
public void saveTaskState(DBRRunnableContext runnableContext, Map<String, Object> state) {
mainPage.saveState();
settingsPage.saveState();
getSettings().saveSettings(runnableContext, new TaskPreferenceStore(state));
}

Expand All @@ -76,8 +77,16 @@ protected MySQLScriptExecuteSettings createSettings() {
@Override
public void addPages() {
addTaskConfigPages();
addPage(mainPage);
addPage(settingsPage);
super.addPages();
}

@Override
public IWizardPage getNextPage(IWizardPage page) {
if (page == settingsPage) {
return null;
}
return super.getNextPage(page);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public SCMENumber(@NotNull SCMCompositeNode parent, @NotNull SCMSourceScanner sc
}

public Number getNumberValue() {
return new Double(getPlainValue());
return Double.parseDouble(getPlainValue());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.jkiss.utils.CommonUtils;
import org.osgi.framework.Bundle;

import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -191,8 +192,8 @@ public <T> T createInstance(Class<T> type)
throw new DBException("Can't load class '" + getImplName() + "'");
}
try {
return objectClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
return objectClass.getDeclaredConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
throw new DBException("Can't instantiate class '" + getImplName() + "'", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void setValue(String name, double value) {
props.putDouble(name, value);
}
dirty = true;
firePropertyChangeEvent(name, new Double(oldValue), new Double(value));
firePropertyChangeEvent(name, oldValue, value);
}

@Override
Expand All @@ -187,7 +187,7 @@ public void setValue(String name, float value) {
props.putFloat(name, value);
}
dirty = true;
firePropertyChangeEvent(name, new Float(oldValue), new Float(value));
firePropertyChangeEvent(name, oldValue, value);
}

@Override
Expand All @@ -202,7 +202,7 @@ public void setValue(String name, int value) {
props.putInt(name, value);
}
dirty = true;
firePropertyChangeEvent(name, new Integer(oldValue), new Integer(value));
firePropertyChangeEvent(name, oldValue, value);
}

@Override
Expand All @@ -217,7 +217,7 @@ public void setValue(String name, long value) {
props.putLong(name, value);
}
dirty = true;
firePropertyChangeEvent(name, new Long(oldValue), new Long(value));
firePropertyChangeEvent(name, oldValue, value);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public DataFormatterDescriptor(IConfigurationElement config)
}
Class<?> objectClass = getObjectClass(config.getAttribute("sampleClass"));
try {
sample = (DBDDataFormatterSample)objectClass.newInstance();
sample = (DBDDataFormatterSample)objectClass.getDeclaredConstructor().newInstance();
} catch (Exception e) {
log.error("Can't instantiate data formatter '" + getId() + "' sample");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.jkiss.dbeaver.model.net.ssh;

import java.util.List;
import java.util.Vector;

import com.jcraft.jsch.Buffer;
import com.jcraft.jsch.IdentityRepository;
import com.jcraft.jsch.JSchException;

import java.util.List;
import java.util.Vector;

public class DBeaverIdentityRepository implements IdentityRepository {

private SSHImplementationAbstract impl;
Expand All @@ -18,7 +18,7 @@ public DBeaverIdentityRepository(SSHImplementationAbstract impl, List<SSHAgentId
}

@Override
public Vector getIdentities() {
public Vector<?> getIdentities() {
Vector<com.jcraft.jsch.Identity> result = new Vector<com.jcraft.jsch.Identity>();

for (SSHAgentIdentity identity : identities) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,14 @@

package org.jkiss.dbeaver.team.git.ui;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Plugin;
import org.jkiss.dbeaver.Log;
import org.osgi.framework.BundleContext;

public class Activator extends Plugin {

//private static final Log log = Log.getLog(Activator.class);


@Override
public void startup() throws CoreException {
//super.startup();
//log.info("Activator git startup");
}

@Override
public void start(BundleContext context) throws Exception {
//super.start(context);
//log.info("Activator git start");
super.start(context);
}

}

0 comments on commit daa700b

Please sign in to comment.