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 with TypeDefinition #629

Closed
angelozerr opened this issue Apr 11, 2020 · 0 comments · Fixed by #771
Closed

NPE with TypeDefinition #629

angelozerr opened this issue Apr 11, 2020 · 0 comments · Fixed by #771
Assignees
Labels
bug Something isn't working CM Extension Content Model extension (XML Schema & DTD)
Milestone

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Apr 11, 2020

Download XML Schema https://github.com/redhat-developer/vscode-xml/files/4029276/AUTOSAR_00048.zip

Write xml like this:

<?xml version="1.0" encoding="UTF-8" ?>
<AUTOSAR xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://autosar.org/schema/r4.0" xsi:schemaLocation="http://autosar.org/schema/r4.0 AUTOSAR_00048.xsd">
  <AR-PACKAGES>

When you do find type definition is done for AR-PACKAGES, you will have this NPE:

[Error - 10:35:25] Request textDocument/typeDefinition failed.
  Message: Internal error.
  Code: -32603 
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.biApply(CompletableFuture.java:1107)
	at java.util.concurrent.CompletableFuture$BiApply.tryFire(CompletableFuture.java:1070)
	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.lemminx.extensions.xsd.contentmodel.CMXSDDocument.getComplexTypeOffset(CMXSDDocument.java:472)
	at org.eclipse.lemminx.extensions.xsd.contentmodel.CMXSDDocument.findLocalXSElement(CMXSDDocument.java:430)
	at org.eclipse.lemminx.extensions.xsd.contentmodel.CMXSDDocument.findTypeLocation(CMXSDDocument.java:295)
	at org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelTypeDefinitionParticipant.doFindTypeDefinition(ContentModelTypeDefinitionParticipant.java:57)
	at org.eclipse.lemminx.services.extensions.AbstractTypeDefinitionParticipant.findTypeDefinition(AbstractTypeDefinitionParticipant.java:35)
	at org.eclipse.lemminx.services.XMLTypeDefinition.findTypeDefinition(XMLTypeDefinition.java:54)
	at org.eclipse.lemminx.services.XMLLanguageService.findTypeDefinition(XMLLanguageService.java:233)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$typeDefinition$15(XMLTextDocumentService.java:324)
	at java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1105)
	... 6 more
@angelozerr angelozerr added bug Something isn't working CM Extension Content Model extension (XML Schema & DTD) labels Apr 11, 2020
@angelozerr angelozerr self-assigned this Jun 3, 2020
@fbricon fbricon added this to the 0.12.0 milestone Jun 3, 2020
@angelozerr angelozerr changed the title NPE withTypeDefinition NPE with TypeDefinition Jun 8, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 8, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 9, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Jun 10, 2020
xorye pushed a commit that referenced this issue Jun 10, 2020
Fixes #629

Signed-off-by: azerr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CM Extension Content Model extension (XML Schema & DTD)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants