Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE while updating Spring Boot version #1241

Closed
martinlippert opened this issue Apr 26, 2024 · 5 comments
Closed

NPE while updating Spring Boot version #1241

martinlippert opened this issue Apr 26, 2024 · 5 comments
Assignees

Comments

@martinlippert
Copy link
Member

Used the latest snapshot build for 4.22.1 on Eclipse 2024-03, created a Rest Service sample from the guides, and tried to execute the quick fix to upgrade the boot version to the latest patch via right-click on the problem in the problems view.

Executing the quick fix results in:

java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "org.eclipse.lsp4j.ChangeAnnotation.getNeedsConfirmation()" is null
	at org.eclipse.lsp4e.LSPEclipseUtils.lambda$1(LSPEclipseUtils.java:936)
	at java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
	at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1856)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632)
	at org.eclipse.lsp4e.LSPEclipseUtils.applyWorkspaceEdit(LSPEclipseUtils.java:936)
	at org.eclipse.lsp4e.LanguageClientImpl$3.run(LanguageClientImpl.java:127)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
@martinlippert
Copy link
Member Author

This seems to break more than just the boot upgrade via quick fix. When I execute the quick fix to remove @Autowired from a constructor, the same error message appears. This is seriously broken.

@martinlippert
Copy link
Member Author

I also observed the Convert @Autowired field into Constructor quick fix to not do anything (also broken), but it does not show up the error above, just does nothing. Maybe the same, maybe a different issue.

@BoykoAlex
Copy link
Contributor

I also observed the Convert @Autowired field into Constructor quick fix to not do anything (also broken), but it does not show up the error above, just does nothing. Maybe the same, maybe a different issue.

I saw that only some cases don't work... Need to investigate why that happens. It worked fine for me now but it could be a different rewrite snapshot.

I'm creating a PR for the NPE you've observed above.

@BoykoAlex
Copy link
Contributor

Here is the lsp4e PR: eclipse-lsp4e/lsp4e#979

@BoykoAlex
Copy link
Contributor

Fixed and the new distro has the lsp4e snapshot with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants