Skip to content

Commit f4fa384

Browse files
committed
Replace deprecate API
1 parent 77d23f9 commit f4fa384

File tree

1 file changed

+2
-4
lines changed
  • codegen/src/main/java/org/seasar/doma/gradle/codegen/util

1 file changed

+2
-4
lines changed

codegen/src/main/java/org/seasar/doma/gradle/codegen/util/ClassUtil.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ public static <T> T newInstance(Class<T> supertype, String className, String pro
6262
throw new CodeGenException(Message.DOMAGEN0014, propertyName, className, supertype.getName());
6363
}
6464
try {
65-
return supertype.cast(clazz.newInstance());
66-
} catch (InstantiationException e) {
67-
throw new CodeGenException(Message.DOMAGEN0015, propertyName, className, e);
68-
} catch (IllegalAccessException e) {
65+
return supertype.cast(clazz.getDeclaredConstructor().newInstance());
66+
} catch (ReflectiveOperationException e) {
6967
throw new CodeGenException(Message.DOMAGEN0015, propertyName, className, e);
7068
}
7169
}

0 commit comments

Comments
 (0)