@@ -186,7 +186,7 @@ public static final class ValueAndType {
186186
187187 public ValueAndType (Class type , Object value ) {
188188 this .type = type ;
189- this .value = Optional .of (value );
189+ this .value = Optional .ofNullable (value );
190190 }
191191
192192 public ValueAndType (Class type ) {
@@ -290,7 +290,7 @@ private void detectTaskProperties(NbProjectInfoModel model) {
290290 Map <String , Object > taskProperties = new HashMap <>();
291291 Map <String , String > taskPropertyTypes = new HashMap <>();
292292
293- Map <String , Task > taskList = project .getTasks ().getAsMap ();
293+ Map <String , Task > taskList = new HashMap <>( project .getTasks ().getAsMap () );
294294 for (String s : taskList .keySet ()) {
295295 Task task = taskList .get (s );
296296 Class taskClass = task .getClass ();
@@ -307,7 +307,7 @@ private void detectTaskProperties(NbProjectInfoModel model) {
307307 private void detectTaskDependencies (NbProjectInfoModel model ) {
308308 Map <String , Object > tasks = new HashMap <>();
309309
310- Map <String , Task > taskList = project .getTasks ().getAsMap ();
310+ Map <String , Task > taskList = new HashMap <>( project .getTasks ().getAsMap () );
311311 for (String s : taskList .keySet ()) {
312312 Task task = taskList .get (s );
313313 Map <String , String > taskInfo = new HashMap <>();
@@ -684,7 +684,7 @@ private void inspectObjectAndValues0(Class clazz, Object object, String prefix,
684684 }
685685
686686 NamedDomainObjectContainer nc = (NamedDomainObjectContainer )value ;
687- Map <String , ?> m = nc .getAsMap ();
687+ Map <String , ?> m = new HashMap <>( nc .getAsMap () );
688688 List <String > ss = new ArrayList <>(m .keySet ());
689689 propertyTypes .put (prefix + propName + COLLECTION_KEYS_MARKER , String .join (";;" , ss ));
690690 for (String k : m .keySet ()) {
@@ -1000,14 +1000,12 @@ private void detectSources(NbProjectInfoModel model) {
10001000
10011001 List <String > compilerArgs ;
10021002
1003- try {
1004- compilerArgs = (List <String >) getProperty (compileTask , "options" , "allCompilerArgs" );
1005- } catch (Throwable ex ) {
1006- try {
1007- compilerArgs = (List <String >) getProperty (compileTask , "options" , "compilerArgs" );
1008- } catch (Throwable ex2 ) {
1009- compilerArgs = (List <String >) getProperty (compileTask , "kotlinOptions" , "freeCompilerArgs" );
1010- }
1003+ compilerArgs = (List <String >) getProperty (compileTask , "options" , "allCompilerArgs" );
1004+ if (compilerArgs == null ) {
1005+ compilerArgs = (List <String >) getProperty (compileTask , "options" , "compilerArgs" );
1006+ }
1007+ if (compilerArgs == null ) {
1008+ compilerArgs = (List <String >) getProperty (compileTask , "kotlinOptions" , "freeCompilerArgs" );
10111009 }
10121010 model .getInfo ().put (propBase + lang + "_compiler_args" , new ArrayList <>(compilerArgs ));
10131011 }
0 commit comments