diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java index b7bb167..cb13a1f 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java @@ -56,7 +56,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader { if(!event.isEmpty()) return event.get(0).getTime()*scvSimProps.getTime_resolution(); } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { e.printStackTrace(); } return 0L; @@ -73,7 +73,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader { streams.add(stream); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { } return streams; } @@ -109,7 +109,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader { } pcs.firePropertyChange(IWaveformDbLoader.LOADING_FINISHED, null, null); } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { throw new InputFormatException(e.toString()); } } diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java index 8b4aae3..d3ed2ec 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java @@ -78,7 +78,7 @@ public class Tx implements ITx { begin= scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION"); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { } } return begin; @@ -94,7 +94,7 @@ public class Tx implements ITx { end = scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION"); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { } } return end; @@ -112,7 +112,7 @@ public class Tx implements ITx { } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { } } return attributes; @@ -129,7 +129,7 @@ public class Tx implements ITx { incoming.add(createRelation(scvRelation, false)); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { } } return incoming; @@ -146,7 +146,7 @@ public class Tx implements ITx { outgoing.add(createRelation(scvRelation, true)); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { } } return outgoing; @@ -169,7 +169,7 @@ public class Tx implements ITx { else return new TxRelation(trStream.getRelationType(rel.getName()), that, this); } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { e.printStackTrace(); } diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java index 1bcaca9..45002a4 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java @@ -69,7 +69,7 @@ public class TxGenerator extends AbstractTxStream { transactions.put(scvTx.getId(), new Tx(database, (TxStream) stream, this, scvTx)); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { e.printStackTrace(); } } diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java index 57f2ab4..35da3e4 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java @@ -63,7 +63,7 @@ public class TxStream extends AbstractTxStream { generators.put(scvGenerator.getId(), new TxGenerator(database, this, scvGenerator)); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { e.printStackTrace(); } } @@ -81,7 +81,7 @@ public class TxStream extends AbstractTxStream { transactions.put(scvTx.getId(), new Tx(database, this, generators.get(scvTx.getGenerator()), scvTx)); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException - | InvocationTargetException | SQLException | IntrospectionException e) { + | InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) { e.printStackTrace(); } } diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java index 68b9f2a..7bb578f 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java @@ -75,10 +75,11 @@ public class SQLiteDatabaseSelectHandler extends AbstractDatabaseHandler { * @throws IllegalAccessException * @throws IntrospectionException * @throws InvocationTargetException + * @throws NoSuchMethodException */ public synchronized List selectObjects() throws SQLException, InstantiationException, IllegalAccessException, - IntrospectionException, InvocationTargetException { + IntrospectionException, InvocationTargetException, IllegalArgumentException, NoSuchMethodException, SecurityException { Connection connection = null; Statement statement = null; @@ -113,17 +114,18 @@ public class SQLiteDatabaseSelectHandler extends AbstractDatabaseHandler { * @throws IllegalAccessException * @throws IntrospectionException * @throws InvocationTargetException + * @throws NoSuchMethodException */ private List createObjects(ResultSet resultSet) throws SQLException, InstantiationException, IllegalAccessException, IntrospectionException, - InvocationTargetException { + InvocationTargetException, IllegalArgumentException, NoSuchMethodException, SecurityException { List list = new ArrayList<>(); while (resultSet.next()) { - T instance = type.newInstance(); + T instance = type.getDeclaredConstructor().newInstance(); for (Field field : type.getDeclaredFields()) {