Skip to content

Commit

Permalink
Fixing project loading issues with micronaut complex project.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdedic authored and lkishalmi committed Dec 23, 2022
1 parent 6c11e07 commit 73dbc4e
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static final class ValueAndType {

public ValueAndType(Class type, Object value) {
this.type = type;
this.value = Optional.of(value);
this.value = Optional.ofNullable(value);
}

public ValueAndType(Class type) {
Expand Down Expand Up @@ -290,7 +290,7 @@ private void detectTaskProperties(NbProjectInfoModel model) {
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();
Expand All @@ -307,7 +307,7 @@ private void detectTaskProperties(NbProjectInfoModel model) {
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<>();
Expand Down Expand Up @@ -684,7 +684,7 @@ private void inspectObjectAndValues0(Class clazz, Object object, String prefix,
}

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()) {
Expand Down Expand Up @@ -1000,14 +1000,12 @@ private void detectSources(NbProjectInfoModel model) {

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));
}
Expand Down

0 comments on commit 73dbc4e

Please sign in to comment.