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 when typing <? #614

Closed
fbricon opened this issue Mar 5, 2020 · 0 comments · Fixed by #617
Closed

NPE when typing <? #614

fbricon opened this issue Mar 5, 2020 · 0 comments · Fixed by #617
Assignees
Labels
bug Something isn't working validation
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Mar 5, 2020

After typing <?, the server throws an NPE during validation:

Message: Unexpected XMLValidator error
java.lang.NullPointerException
	at org.eclipse.lsp4xml.utils.XMLPositionUtility.selectStartTagName(XMLPositionUtility.java:296)
	at org.eclipse.lsp4xml.utils.XMLPositionUtility.selectStartTagName(XMLPositionUtility.java:270)
	at org.eclipse.lsp4xml.utils.XMLPositionUtility.selectRootStartTag(XMLPositionUtility.java:250)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.XMLSyntaxErrorCode.toLSPRange(XMLSyntaxErrorCode.java:182)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.diagnostics.LSPErrorReporterForXML.toLSPRange(LSPErrorReporterForXML.java:50)
	at org.eclipse.lsp4xml.services.extensions.diagnostics.AbstractLSPErrorReporter.internalToLSPRange(AbstractLSPErrorReporter.java:139)
	at org.eclipse.lsp4xml.services.extensions.diagnostics.AbstractLSPErrorReporter.reportError(AbstractLSPErrorReporter.java:80)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.scanNCName(Unknown Source)
	at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.diagnostics.XMLValidator.doDiagnostics(XMLValidator.java:111)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.diagnostics.ContentModelDiagnosticsParticipant.doDiagnostics(ContentModelDiagnosticsParticipant.java:46)
	at org.eclipse.lsp4xml.services.XMLDiagnostics.doExtensionsDiagnostics(XMLDiagnostics.java:83)
	at org.eclipse.lsp4xml.services.XMLDiagnostics.doDiagnostics(XMLDiagnostics.java:51)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doDiagnostics(XMLLanguageService.java:151)
	at org.eclipse.lsp4xml.services.XMLLanguageService.publishDiagnostics(XMLLanguageService.java:160)
	at org.eclipse.lsp4xml.XMLTextDocumentService.validate(XMLTextDocumentService.java:434)
	at org.eclipse.lsp4xml.XMLTextDocumentService.lambda$triggerValidationFor$23(XMLTextDocumentService.java:427)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

@fbricon fbricon added bug Something isn't working validation labels Mar 5, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Mar 9, 2020
Fixes eclipse#614

Signed-off-by: azerr <[email protected]>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Mar 9, 2020
Fixes eclipse#614

Signed-off-by: azerr <[email protected]>
@angelozerr angelozerr added this to the 0.10.1 milestone Mar 9, 2020
@angelozerr angelozerr self-assigned this Mar 9, 2020
fbricon pushed a commit that referenced this issue Mar 9, 2020
Fixes #614

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 validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants