mbien opened a new pull request, #8924: URL: https://github.com/apache/netbeans/pull/8924
hotfix for regression (since https://github.com/apache/netbeans/pull/8713). Would be good to refactor the utility to return non-null values in future, usages treat empty list and null the same. ``` java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "org.netbeans.modules.java.hints.errors.CreateElementUtilities.resolveType(java.util.Set, org.netbeans.api.java.source.CompilationInfo, com.sun.source.util.TreePath, com.sun.source.tree.Tree, int, javax.lang.model.type.TypeMirror[], int[])" is null at org.netbeans.modules.java.hints.errors.CreateElementUtilities.computeLambdaReturn(CreateElementUtilities.java:566) at org.netbeans.modules.java.hints.errors.CreateElementUtilities.resolveType(CreateElementUtilities.java:216) at org.netbeans.modules.java.hints.errors.CreateElement.analyzeImpl(CreateElement.java:333) at org.netbeans.modules.java.hints.errors.CreateElement.analyze(CreateElement.java:131) at org.netbeans.modules.java.hints.errors.CreateElement.run(CreateElement.java:116) at org.netbeans.modules.java.hints.infrastructure.CreatorBasedLazyFixList.compute(CreatorBasedLazyFixList.java:128) at org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.run(LazyHintComputation.java:87) at org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.run(LazyHintComputation.java:33) [catch] at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:273) at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561) at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018) ``` reproducer taken from a different/unrelated issue (https://github.com/apache/netbeans/issues/4668): <details> ```java package testapp; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { static String letterGrade(Student s) { int percent = 0; //s.getPercent(); if (percent > 90) return "A"; if (percent > 80) return "B"; if (percent > 70) return "C"; return "D"; } public static void main(String[] args) { Stream.of(new Student(null, null)) .collect(Collectors.groupingBy(s -> letterGrade(s), Collectors.mapping(s -> ))) } } class Student { private String name; private int percent; public Student(String name, int percent) { this.name = name; this.percent = percent; } } ``` </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
