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

Self closing tag causes NPE in cvc_complex_type_2_1CodeAction.doCodeAction #339

Closed
fbricon opened this issue Apr 3, 2019 · 0 comments
Closed
Assignees
Labels
bug Something isn't working code action
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Apr 3, 2019

At the root of lsp4xml (with money.xsd present), create a file with :

<money xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="org.eclipse.lsp4xml/src/test/resources/xsd/money.xsd" currency="euros"> </money>

When self closing the money tag, an NPE is thrown:

Error - 3:22:55 p.m.] Apr 03, 2019 03:22:55 org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError()
Message: Internal error: java.lang.NullPointerException
java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NullPointerException
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.codeactions.cvc_complex_type_2_1CodeAction.doCodeAction(cvc_complex_type_2_1CodeAction.java:42)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.ContentModelCodeActionParticipant.doCodeAction(ContentModelCodeActionParticipant.java:45)
	at org.eclipse.lsp4xml.services.XMLCodeActions.doCodeActions(XMLCodeActions.java:43)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doCodeActions(XMLLanguageService.java:188)
	at org.eclipse.lsp4xml.XMLTextDocumentService.lambda$codeAction$15(XMLTextDocumentService.java:340)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	... 6 more

Apr-03-2019 15-23-57

@fbricon fbricon added bug Something isn't working code action labels Apr 3, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Apr 3, 2019
Fixes eclipse#339

Signed-off-by: Nikolas Komonen <nikolaskomonen@gmail.com>
@NikolasKomonen NikolasKomonen self-assigned this Apr 3, 2019
@NikolasKomonen NikolasKomonen added this to the v0.5.0 milestone Apr 3, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Apr 3, 2019
Fixes eclipse#12
Fixes eclipse#339

Signed-off-by: Nikolas Komonen <nikolaskomonen@gmail.com>
fbricon pushed a commit that referenced this issue Apr 3, 2019
Fixes #12
Fixes #339

Signed-off-by: Nikolas Komonen <nikolaskomonen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code action
Projects
None yet
Development

No branches or pull requests

2 participants