Skip to content

NPE when typing <? #614

@fbricon

Description

@fbricon

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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions