Skip to content

rare NPE in classpath listener #966

Closed
@martinlippert

Description

@martinlippert

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions