Community
Participate
Working Groups
Just updated to new 2021-12 and getting NPE trying to run search Stacktrace: java.lang.NullPointerException at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469) at java.base/java.util.Comparators$NullComparator.compare(Comparators.java:83) at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.base/java.util.TimSort.sort(TimSort.java:234) at java.base/java.util.Arrays.sort(Arrays.java:1515) at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:417) at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:450) at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:60) at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:236) at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Session Data: eclipse.buildId=4.22.0.I20211124-1800 java.version=11.0.5 java.vendor=AdoptOpenJDK BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.modeling.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.modeling.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.modeling.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.modeling.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.modeling.product -data C:\eclipse\baws2003 -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.modeling.product Search for: endPoint, case sensitive in workspace, patterns: *.css, *.e4xmi, *.ecore, *.exsd, *.genmodel, *.java, *.js, *.odesign, *.product, *.properties, *.view, *.xml, *.zul, MANIFEST.MF Note that changing the pattern to only *.java runs w/o error.
I tried with various combination of pattern, and of those listed, the following are failing (others are not): - * (obviously) - MANIFEST.MF - *.xml
Regression from bug 575893 changes. Jörg, please take a look.
(In reply to Andrey Loskutov from comment #2) > Regression from bug 575893 changes. I mean this one https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/185194/6/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
hmm, i was not able to reproduce it. And at a first look i do not see the error in the sourcecode. @Alain, could you please upload a simple Project where the error occurs so that i could debug?
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/188739
(In reply to Jörg Kubitz from comment #4) > hmm, i was not able to reproduce it. > And at a first look i do not see the error in the sourcecode. > @Alain, could you please upload a simple Project where the error occurs so > that i could debug? Jörg, I have a workspace with a few hundred projects, and I have no idea from the reported error where it comes from. How can I narrow it down more than the types I have reported, then will gladly try to get you a reproducible case.
@Alain can you start eclipse with a jdk 17 please to get a rich NPE message? Maybe that helps
(In reply to Jörg Kubitz from comment #7) > @Alain > can you start eclipse with a jdk 17 please to get a rich NPE message? Maybe > that helps Here is the new stacktrace with Java 17 java.lang.NullPointerException: Cannot invoke "java.lang.Comparable.compareTo(Object)" because the return value of "java.util.function.Function.apply(Object)" is null at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:473) at java.base/java.util.Comparators$NullComparator.compare(Comparators.java:85) at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.base/java.util.TimSort.sort(TimSort.java:234) at java.base/java.util.Arrays.sort(Arrays.java:1307) at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:417) at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:450) at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:60) at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:236) at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
(In reply to Alain Picard from comment #8) > Here is the new stacktrace with Java 17 > > java.lang.NullPointerException: Cannot invoke > "java.lang.Comparable.compareTo(Object)" because the return value of > "java.util.function.Function.apply(Object)" is null thanks. that makes it a little more clear.
(In reply to Jörg Kubitz from comment #9) > (In reply to Alain Picard from comment #8) > > Here is the new stacktrace with Java 17 > > > > java.lang.NullPointerException: Cannot invoke > > "java.lang.Comparable.compareTo(Object)" because the return value of > > "java.util.function.Function.apply(Object)" is null > > thanks. that makes it a little more clear. Got another variation this time: java.lang.NullPointerException: Cannot read field "value" because "anotherString" is null at java.base/java.lang.String.compareTo(String.java:2012) at java.base/java.lang.String.compareTo(String.java:140) at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:473) at java.base/java.util.Comparators$NullComparator.compare(Comparators.java:85) at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.base/java.util.TimSort.sort(TimSort.java:234) at java.base/java.util.Arrays.sort(Arrays.java:1307) at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:417) at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:450) at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:60) at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:236) at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/188739 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=1d2045ac059524c6cb87b0f6004d9ae4669b2d6b
*** Bug 578374 has been marked as a duplicate of this bug. ***
Hi Jörg - did you ever find out the condition that exposes this bug? I was wondering if some use cases (e.g. remote dev?) make it more likely to be hit.
(In reply to Jonah Graham from comment #13) > Hi Jörg - did you ever find out the condition that exposes this bug? I was > wondering if some use cases (e.g. remote dev?) make it more likely to be hit. There must be an IFile with org.eclipse.core.resources.IResource.getLocation()==null. I do not know when that actually happens. With normal files it does not. The javadoc says: "If this resource is a project that does not exist in the workspace, or a file or folder below such a project, this method returns <code>null</code>. This method also returns <code>null</code> if called on a resource that is not stored in the local file system." more intersting: For such resources {@link #getLocationURI()} should be used instead. May be the results for such files are not deterministically ordered at the moment.
(In reply to Jörg Kubitz from comment #14) Thanks for that. > May be the results for such files are not deterministically ordered at the > moment. I would guess so.
*** Bug 577897 has been marked as a duplicate of this bug. ***