Skip to content

Commit cce6f80

Browse files
committed
Replace deprecated newInstance, pass exception to runtime exception
1 parent e917c4e commit cce6f80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jme3-core/src/main/java/com/jme3/util/struct/fields/SubStructArrayField.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public SubStructArrayField(int position, String name, int length, Class<? extend
2020
private void initializeToZero(Class<? extends T> structClass) {
2121
for (int i = 0; i < value.length; i++) {
2222
if (value[i] == null) try {
23-
value[i] = structClass.newInstance();
23+
value[i] = structClass.getDeclaredConstructor().newInstance();
2424
} catch (Exception e) {
25-
throw new RuntimeException("Can't create new instance of " + structClass + " default constructor is missing?");
25+
throw new RuntimeException("Can't create new instance of " + structClass + " default constructor is missing? ",e);
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)