Closed bergmanngabor closed 11 years ago
NPE in Cartesian validator when trying to invoke content assist because pathExpressionHead.getSrc() is null. Seems harmless, because it is caught at some point.
pathExpressionHead.getSrc()
How to reproduce:
pattern bugtriage(sch) = { School(sch); School.name(sch,Name); School.<<CTRL+SPACE>>(_sch,Name); }
Stack trace:
Thread [Worker-66] (Suspended (exception java.lang.NullPointerException)) org.eclipse.incquery.patternlanguage.emf.ui.validation.GenmodelBasedEMFPatternLanguageJavaValidator(org.eclipse.incquery.patternlanguage.emf.validation.EMFPatternLanguageJavaValidator).checkForCartesianProduct(org.eclipse.incquery.patternlanguage.patternLanguage.PatternBody) line: 365 sun.reflect.GeneratedMethodAccessor41.invoke(java.lang.Object, java.lang.Object[]) line: not available sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: not available java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: not available org.eclipse.xtext.validation.AbstractDeclarativeValidator$MethodWrapper.invoke(org.eclipse.xtext.validation.AbstractDeclarativeValidator$State) line: 109 org.eclipse.incquery.patternlanguage.emf.ui.validation.GenmodelBasedEMFPatternLanguageJavaValidator(org.eclipse.xtext.validation.AbstractDeclarativeValidator).internalValidate(org.eclipse.emf.ecore.EClass, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 291 org.eclipse.incquery.patternlanguage.emf.ui.validation.GenmodelBasedEMFPatternLanguageJavaValidator(org.eclipse.xtext.validation.AbstractInjectableValidator).validate(org.eclipse.emf.ecore.EClass, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 62 org.eclipse.xtext.validation.CompositeEValidator.validate(org.eclipse.emf.ecore.EClass, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 126 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).validate(org.eclipse.emf.ecore.EClass, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 165 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).validate(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 143 org.eclipse.xtext.validation.CancelableDiagnostician.validate(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 36 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).doValidateContents(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 184 org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 48 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).validate(org.eclipse.emf.ecore.EClass, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 168 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).validate(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 143 org.eclipse.xtext.validation.CancelableDiagnostician.validate(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 36 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).doValidateContents(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 180 org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 48 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).validate(org.eclipse.emf.ecore.EClass, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 168 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).validate(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 143 org.eclipse.xtext.validation.CancelableDiagnostician.validate(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.Object>) line: 36 org.eclipse.xtext.validation.CancelableDiagnostician(org.eclipse.emf.ecore.util.Diagnostician).validate(org.eclipse.emf.ecore.EObject, java.util.Map<?,?>) line: 126 org.eclipse.xtext.validation.ResourceValidatorImpl.validate(org.eclipse.emf.ecore.resource.Resource, org.eclipse.xtext.validation.CheckMode, org.eclipse.xtext.util.CancelIndicator) line: 108 org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(org.eclipse.xtext.resource.XtextResource) line: 79 org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(java.lang.Object) line: 1 org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker(org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces<P>).readOnly(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,P>) line: 32 org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource>) line: 78 org.eclipse.xtext.ui.editor.validation.ValidationJob.createIssues(org.eclipse.core.runtime.IProgressMonitor) line: 75 org.eclipse.xtext.ui.editor.validation.ValidationJob.run(org.eclipse.core.runtime.IProgressMonitor) line: 64 org.eclipse.core.internal.jobs.Worker.run() line: 54
I fixed it in the validator with a null check, should be okay from now.
Fixed.
NPE in Cartesian validator when trying to invoke content assist because
pathExpressionHead.getSrc()
is null. Seems harmless, because it is caught at some point.How to reproduce:
Stack trace: