renmove deprecated newInstance call
This commit is contained in:
parent
6d8aa33fc9
commit
6be3f378d4
|
@ -56,7 +56,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
|
||||||
if(!event.isEmpty())
|
if(!event.isEmpty())
|
||||||
return event.get(0).getTime()*scvSimProps.getTime_resolution();
|
return event.get(0).getTime()*scvSimProps.getTime_resolution();
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return 0L;
|
return 0L;
|
||||||
|
@ -73,7 +73,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
|
||||||
streams.add(stream);
|
streams.add(stream);
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
}
|
}
|
||||||
return streams;
|
return streams;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
|
||||||
}
|
}
|
||||||
pcs.firePropertyChange(IWaveformDbLoader.LOADING_FINISHED, null, null);
|
pcs.firePropertyChange(IWaveformDbLoader.LOADING_FINISHED, null, null);
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
throw new InputFormatException(e.toString());
|
throw new InputFormatException(e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class Tx implements ITx {
|
||||||
begin= scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION");
|
begin= scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION");
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return begin;
|
return begin;
|
||||||
|
@ -94,7 +94,7 @@ public class Tx implements ITx {
|
||||||
end = scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION");
|
end = scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION");
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return end;
|
return end;
|
||||||
|
@ -112,7 +112,7 @@ public class Tx implements ITx {
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return attributes;
|
return attributes;
|
||||||
|
@ -129,7 +129,7 @@ public class Tx implements ITx {
|
||||||
incoming.add(createRelation(scvRelation, false));
|
incoming.add(createRelation(scvRelation, false));
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return incoming;
|
return incoming;
|
||||||
|
@ -146,7 +146,7 @@ public class Tx implements ITx {
|
||||||
outgoing.add(createRelation(scvRelation, true));
|
outgoing.add(createRelation(scvRelation, true));
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return outgoing;
|
return outgoing;
|
||||||
|
@ -169,7 +169,7 @@ public class Tx implements ITx {
|
||||||
else
|
else
|
||||||
return new TxRelation(trStream.getRelationType(rel.getName()), that, this);
|
return new TxRelation(trStream.getRelationType(rel.getName()), that, this);
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class TxGenerator extends AbstractTxStream {
|
||||||
transactions.put(scvTx.getId(), new Tx(database, (TxStream) stream, this, scvTx));
|
transactions.put(scvTx.getId(), new Tx(database, (TxStream) stream, this, scvTx));
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class TxStream extends AbstractTxStream {
|
||||||
generators.put(scvGenerator.getId(), new TxGenerator(database, this, scvGenerator));
|
generators.put(scvGenerator.getId(), new TxGenerator(database, this, scvGenerator));
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class TxStream extends AbstractTxStream {
|
||||||
transactions.put(scvTx.getId(), new Tx(database, this, generators.get(scvTx.getGenerator()), scvTx));
|
transactions.put(scvTx.getId(), new Tx(database, this, generators.get(scvTx.getGenerator()), scvTx));
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,10 +75,11 @@ public class SQLiteDatabaseSelectHandler<T> extends AbstractDatabaseHandler<T> {
|
||||||
* @throws IllegalAccessException
|
* @throws IllegalAccessException
|
||||||
* @throws IntrospectionException
|
* @throws IntrospectionException
|
||||||
* @throws InvocationTargetException
|
* @throws InvocationTargetException
|
||||||
|
* @throws NoSuchMethodException
|
||||||
*/
|
*/
|
||||||
public synchronized List<T> selectObjects() throws SQLException,
|
public synchronized List<T> selectObjects() throws SQLException,
|
||||||
InstantiationException, IllegalAccessException,
|
InstantiationException, IllegalAccessException,
|
||||||
IntrospectionException, InvocationTargetException {
|
IntrospectionException, InvocationTargetException, IllegalArgumentException, NoSuchMethodException, SecurityException {
|
||||||
|
|
||||||
Connection connection = null;
|
Connection connection = null;
|
||||||
Statement statement = null;
|
Statement statement = null;
|
||||||
|
@ -113,17 +114,18 @@ public class SQLiteDatabaseSelectHandler<T> extends AbstractDatabaseHandler<T> {
|
||||||
* @throws IllegalAccessException
|
* @throws IllegalAccessException
|
||||||
* @throws IntrospectionException
|
* @throws IntrospectionException
|
||||||
* @throws InvocationTargetException
|
* @throws InvocationTargetException
|
||||||
|
* @throws NoSuchMethodException
|
||||||
*/
|
*/
|
||||||
private List<T> createObjects(ResultSet resultSet)
|
private List<T> createObjects(ResultSet resultSet)
|
||||||
throws SQLException, InstantiationException,
|
throws SQLException, InstantiationException,
|
||||||
IllegalAccessException, IntrospectionException,
|
IllegalAccessException, IntrospectionException,
|
||||||
InvocationTargetException {
|
InvocationTargetException, IllegalArgumentException, NoSuchMethodException, SecurityException {
|
||||||
|
|
||||||
List<T> list = new ArrayList<>();
|
List<T> list = new ArrayList<>();
|
||||||
|
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
|
|
||||||
T instance = type.newInstance();
|
T instance = type.getDeclaredConstructor().newInstance();
|
||||||
|
|
||||||
for (Field field : type.getDeclaredFields()) {
|
for (Field field : type.getDeclaredFields()) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue