@@ -1261,14 +1261,14 @@ private static Value attemptTypeConversion(CompositeValue cv, Env env, Object...
12611261 // If so, then try to instantiate a new instance of the class
12621262 if (TYPE_CLASS .equals (typeValue .getType ())) {
12631263 // Variable maps to a java class
1264- Class c = (Class ) typeValue .get ();
1264+ Class <?> c = (Class <?> ) typeValue .get ();
12651265 try {
1266- Object obj = c .newInstance ();
1266+ Object obj = c .getDeclaredConstructor (). newInstance ();
12671267 // for any field other than the "type", set the value of the field
12681268 // of the created object to the specified value
12691269 for (String s :cv .value .keySet ()) {
12701270 if (!"type" .equals (s )) {
1271- Value v = cv .value .get (s ).evaluate (env , args );
1271+ Value <?> v = cv .value .get (s ).evaluate (env , args );
12721272 try {
12731273 Field f = c .getField (s );
12741274 Object objVal = toCompatibleObject (f , v .get ());
@@ -1281,14 +1281,14 @@ private static Value attemptTypeConversion(CompositeValue cv, Env env, Object...
12811281 }
12821282 }
12831283 return new PrimitiveValue <>(typeName , obj );
1284- } catch (InstantiationException | IllegalAccessException ex ) {
1284+ } catch (ReflectiveOperationException ex ) {
12851285 throw new RuntimeException ("Cannot instantiate " + c , ex );
12861286 }
12871287 } else if (typeValue .get () != null ){
12881288 // When evaluated, variable does not explicitly map to "CLASS"
12891289 // See if we can convert this CompositeValue into appropriate object
12901290 // by calling "create(CompositeValue cv)"
1291- Class c = typeValue .get ().getClass ();
1291+ Class <?> c = typeValue .get ().getClass ();
12921292 try {
12931293 Method m = c .getMethod ("create" , CompositeValue .class );
12941294 CompositeValue evaluatedCv = cv .evaluateNoTypeConversion (env , args );
0 commit comments