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 on xsd datatype autocompletion in binary mode #1189

Closed
jagui opened this issue Mar 25, 2022 · 5 comments · Fixed by #1190
Closed

NPE on xsd datatype autocompletion in binary mode #1189

jagui opened this issue Mar 25, 2022 · 5 comments · Fixed by #1190
Labels
binary bug Something isn't working completion This issue or enhancement is related to completion support XSD
Milestone

Comments

@jagui
Copy link

jagui commented Mar 25, 2022

Hi there,

we're having an issue on several computers running version 0.19.1, both Linux and Windows, while trying to autocomplete an XSD document. Find below the stacktrace.

[Info  - 17:42:04] Mar 22, 2022 05:42:04 org.eclipse.lemminx.XMLLanguageServer initialize() Message: Initializing XML Language server LemMinX Server info:  - Version : 0.19.1  - Native Image  - VM Version : 11.0.9  - Git [Branch 6059965ad91cd67cba1c91f4b82714c57dc64fa5] 6059965 - [maven-release-plugin] prepare release 0.19.1 [Error - 17:42:10] Mar 22, 2022 05:42:10 org.eclipse.lemminx.services.XMLCompletions collectAttributeValueSuggestions() Message: While performing ICompletionParticipant#onAttributeValue for participant 'org.eclipse.lemminx.extensions.xsd.participants.XSDCompletionParticipant'. java.lang.NullPointerException     at org.eclipse.lemminx.extensions.xsd.DataType.getDataTypes(DataType.java:46)     at org.eclipse.lemminx.extensions.xsd.participants.XSDCompletionParticipant.onAttributeValue(XSDCompletionParticipant.java:79)     at org.eclipse.lemminx.services.XMLCompletions.collectAttributeValueSuggestions(XMLCompletions.java:919)     at org.eclipse.lemminx.services.XMLCompletions.doComplete(XMLCompletions.java:153)     at org.eclipse.lemminx.services.XMLLanguageService.doComplete(XMLLanguageService.java:151)     at org.eclipse.lemminx.XMLTextDocumentService.lambda$completion$1(XMLTextDocumentService.java:223)     at java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1236)     at java.util.concurrent.CompletableFuture$BiApply.tryFire(CompletableFuture.java:1205)     at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)     at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)     at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)     at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)     at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)     at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)     at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)     at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)

Thanks in advance 🙇‍♂️

@angelozerr
Copy link
Contributor

Could you please share your xsd please

@angelozerr angelozerr added bug Something isn't working completion This issue or enhancement is related to completion support XSD labels Mar 25, 2022
@jagui
Copy link
Author

jagui commented Mar 25, 2022

Hi, @angelozerr. I believe the xsd is irrelevant, since we're using the same xsd on different computers, and it only fails in a handful of them. Anyway, it's a very simple xsd, just adding an element (I'm teaching XML). I could paste some random xsd here but it feel rather pointless and misleading.

The culprit seems to be on a silently swallowed exception on DataType line 112 which returns a null Map which in turns causes an NPE on DataType's line 46.

@angelozerr
Copy link
Contributor

I think the fix should be easy but we write à test when we fix à bug. I would like to have à usecase which causes the problem. If you have à simple xsd which causes yhe problem it should be really nice.

@angelozerr
Copy link
Contributor

@jagui I can reproduce your problem and the problem is with binary (with Java it works pretty well).

I need to understand the problem.

@angelozerr angelozerr changed the title NPE on xsd autocompletion NPE on xsd autocompletion in binary mode Mar 26, 2022
@angelozerr angelozerr changed the title NPE on xsd autocompletion in binary mode NPE on xsd datatype autocompletion in binary mode Mar 26, 2022
angelozerr added a commit to angelozerr/lemminx that referenced this issue Mar 26, 2022
Fixes eclipse#1189

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr added this to the 0.19.2 milestone Mar 26, 2022
@angelozerr
Copy link
Contributor

@jagui I created the PR #1190 which should fix the problem in binary mode(in Java mode it works).

angelozerr added a commit to angelozerr/lemminx that referenced this issue Mar 28, 2022
Fixes eclipse#1189

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Mar 29, 2022
Fixes eclipse#1189

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Mar 29, 2022
Fixes eclipse#1189

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit that referenced this issue Mar 29, 2022
Fixes #1189

Signed-off-by: azerr <azerr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary bug Something isn't working completion This issue or enhancement is related to completion support XSD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants