renmove deprecated newInstance call

This commit is contained in:
eyck committed 2021-02-18 06:32:14 +00:00
1 parent 6d8aa33fc9
commit 6be3f378d4
5 files changed
+17 -15

No files matched your search

@@ -75,10 +75,11 @@ public class SQLiteDatabaseSelectHandler<T> extends AbstractDatabaseHandler<T> {
* @throws IllegalAccessException
* @throws IntrospectionException
* @throws InvocationTargetException
* @throws NoSuchMethodException
*/
public synchronized List<T> 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<T> extends AbstractDatabaseHandler<T> {
* @throws IllegalAccessException
* @throws IntrospectionException
* @throws InvocationTargetException
* @throws NoSuchMethodException
*/
private List<T> createObjects(ResultSet resultSet)
throws SQLException, InstantiationException,
IllegalAccessException, IntrospectionException,
InvocationTargetException {
InvocationTargetException, IllegalArgumentException, NoSuchMethodException, SecurityException {
List<T> list = new ArrayList<>();
while (resultSet.next()) {
T instance = type.newInstance();
T instance = type.getDeclaredConstructor().newInstance();
for (Field field : type.getDeclaredFields()) {