You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like I have hit a rare moment in time where the editor for the pom.xml file wasn't fully initialized yet when we tried to grab classpath information:
java.lang.NullPointerException: Cannot invoke "org.eclipse.ui.texteditor.ITextEditor.getAdapter(java.lang.Class)" because "this.sourcePage" is null
at org.eclipse.m2e.editor.pom.MavenPomEditor.getAdapter(MavenPomEditor.java:1013)
at org.springframework.tooling.ls.eclipse.commons.STS4LanguageClientImpl.lambda$9(STS4LanguageClientImpl.java:423)
at org.springframework.tooling.jdt.ls.commons.classpath.ReusableClasspathListenerHandler$CallbackJob.lambda$0(ReusableClasspathListenerHandler.java:76)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.tooling.jdt.ls.commons.classpath.ReusableClasspathListenerHandler$CallbackJob.run(ReusableClasspathListenerHandler.java:76)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
This is probably hard to reproduce. It happened when I created a Rest Service sample project right after starting up a fresh install of STS 4.17.2 with a fresh workspace, opened the pom.xml file, and pressed Yes on the reconcile popup - almost everything at the same time.
I'll close it. Also pushed logic to update code minings on classpath changed event only for editors for resources from classpath source folders. Thus, pom are filtered out (27e08f9). It looks like a fair assumption for the moment. Thus, pom editors are not applicable to this code any longer.
Activity
BoykoAlex commentedon Feb 6, 2023
It would have been best if MavenPomEditor doesn't throw an NPE in this case: eclipse-m2e/m2e-core#1235
On our side i think we should catch and log exceptions without short-circuiting the loop: 5d9eee9
BoykoAlex commentedon Feb 6, 2023
I'll close it. Also pushed logic to update code minings on classpath changed event only for editors for resources from classpath source folders. Thus, pom are filtered out (27e08f9). It looks like a fair assumption for the moment. Thus, pom editors are not applicable to this code any longer.