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

Fix NPE in isCompletionInsertReplaceSupport check #2070

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

mfussenegger
Copy link
Contributor

If the capability is missing there was a NullPointerException

java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "org.eclipse.lsp4j.CompletionItemCapabilities.getInsertReplaceSupport()" is null
	at org.eclipse.jdt.ls.core.internal.preferences.ClientPreferences.isCompletionInsertReplaceSupport(ClientPreferences.java:390)
	at org.eclipse.jdt.ls.core.internal.contentassist.CompletionProposalReplacementProvider.updateReplacement(CompletionProposalReplacementProvider.java:198)
	at org.eclipse.jdt.ls.core.internal.contentassist.CompletionProposalReplacementProvider.updateReplacement(CompletionProposalReplacementProvider.java:120)

    java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "org.eclipse.lsp4j.CompletionItemCapabilities.getInsertReplaceSupport()" is null
    	at org.eclipse.jdt.ls.core.internal.preferences.ClientPreferences.isCompletionInsertReplaceSupport(ClientPreferences.java:390)
    	at org.eclipse.jdt.ls.core.internal.contentassist.CompletionProposalReplacementProvider.updateReplacement(CompletionProposalReplacementProvider.java:198)
    	at org.eclipse.jdt.ls.core.internal.contentassist.CompletionProposalReplacementProvider.updateReplacement(CompletionProposalReplacementProvider.java:120)

Signed-off-by: Mathias Fussenegger <f.mathias@zignar.net>
@fbricon fbricon added the bug label Apr 26, 2022
@fbricon fbricon added this to the Early May 2022 milestone Apr 26, 2022
@fbricon fbricon merged commit 18d48fe into eclipse-jdtls:master Apr 26, 2022
@fbricon
Copy link
Contributor

fbricon commented Apr 26, 2022

Thanks @mfussenegger

@mfussenegger mfussenegger deleted the insert-replace-support branch April 26, 2022 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants