This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push: new 861bbffd98 Fixing project loading issues with micronaut complex project. 861bbffd98 is described below commit 861bbffd98935fe96149472fef28bba7e7bf01cc Author: Svata Dedic <svatopluk.de...@oracle.com> AuthorDate: Mon Dec 19 19:15:36 2022 +0100 Fixing project loading issues with micronaut complex project. --- .../gradle/tooling/NbProjectInfoBuilder.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java index 0fd561a2cd..b17933e692 100644 --- a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java +++ b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java @@ -186,7 +186,7 @@ class NbProjectInfoBuilder { public ValueAndType(Class type, Object value) { this.type = type; - this.value = Optional.of(value); + this.value = Optional.ofNullable(value); } public ValueAndType(Class type) { @@ -290,7 +290,7 @@ class NbProjectInfoBuilder { Map<String, Object> taskProperties = new HashMap<>(); Map<String, String> taskPropertyTypes = new HashMap<>(); - Map<String, Task> taskList = project.getTasks().getAsMap(); + Map<String, Task> taskList = new HashMap<>(project.getTasks().getAsMap()); for (String s : taskList.keySet()) { Task task = taskList.get(s); Class taskClass = task.getClass(); @@ -307,7 +307,7 @@ class NbProjectInfoBuilder { private void detectTaskDependencies(NbProjectInfoModel model) { Map<String, Object> tasks = new HashMap<>(); - Map<String, Task> taskList = project.getTasks().getAsMap(); + Map<String, Task> taskList = new HashMap<>(project.getTasks().getAsMap()); for (String s : taskList.keySet()) { Task task = taskList.get(s); Map<String, String> taskInfo = new HashMap<>(); @@ -684,7 +684,7 @@ class NbProjectInfoBuilder { } NamedDomainObjectContainer nc = (NamedDomainObjectContainer)value; - Map<String, ?> m = nc.getAsMap(); + Map<String, ?> m = new HashMap<>(nc.getAsMap()); List<String> ss = new ArrayList<>(m.keySet()); propertyTypes.put(prefix + propName + COLLECTION_KEYS_MARKER, String.join(";;", ss)); for (String k : m.keySet()) { @@ -1000,14 +1000,12 @@ class NbProjectInfoBuilder { List<String> compilerArgs; - try { - compilerArgs = (List<String>) getProperty(compileTask, "options", "allCompilerArgs"); - } catch (Throwable ex) { - try { - compilerArgs = (List<String>) getProperty(compileTask, "options", "compilerArgs"); - } catch (Throwable ex2) { - compilerArgs = (List<String>) getProperty(compileTask, "kotlinOptions", "freeCompilerArgs"); - } + compilerArgs = (List<String>) getProperty(compileTask, "options", "allCompilerArgs"); + if (compilerArgs == null) { + compilerArgs = (List<String>) getProperty(compileTask, "options", "compilerArgs"); + } + if (compilerArgs == null) { + compilerArgs = (List<String>) getProperty(compileTask, "kotlinOptions", "freeCompilerArgs"); } model.getInfo().put(propBase + lang + "_compiler_args", new ArrayList<>(compilerArgs)); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists