|
|
|
|
|
|
|
|
|
|
Re: Inheritance from non-grammar java class [message #1791794 is a reply to message #1791749] |
Thu, 05 July 2018 11:55 |
Karsten Wilken Messages: 59 Registered: August 2016 |
Member |
|
|
I followed your suggestion (from the quoted link)
Christian Dietrich wrote on Thu, 22 August 2013 13:56Hi,
it would be preferred if the exist as osgi bundles. if not
- create a lib folder in the project
- drop the libs there.
- open the manifest file.
- add the libs on the runtime tab/classpath section
- add the lib folder on the build tab of the editor.
I removed all my previous changes to the manifest regarding the base.jar
I added the libs on the classpath section in the runtime tab.
+ add the libs folder to the runtime information on the build tab.
After I build it with clean package (works) and run the Eclipse Application it throws this Exception:
java.lang.NullPointerException
at **package/patch/to/class*.IdWithKeyElementInferrerExtension.lambda$1(IdWithKeyElementInferrerExtension.java:98)
at org.eclipse.xtext.xbase.jvmmodel.JvmModelAssociator$1.run(JvmModelAssociator.java:397)
at org.eclipse.xtext.xbase.jvmmodel.JvmModelAssociator.installDerivedState(JvmModelAssociator.java:407)
at org.eclipse.xtext.resource.DerivedStateAwareResource.installDerivedState(DerivedStateAwareResource.java:242)
at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getContents(BatchLinkableResource.java:148)
at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareBatchTypeResolver.getEntryPoints(LogicalContainerAwareBatchTypeResolver.java:44)
at org.eclipse.xtext.xbase.typesystem.internal.DefaultBatchTypeResolver.getTypeResolver(DefaultBatchTypeResolver.java:84)
at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver$1.get(CachingBatchTypeResolver.java:49)
at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver$1.get(CachingBatchTypeResolver.java:46)
at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:77)
at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver.doResolveTypes(CachingBatchTypeResolver.java:46)
at org.eclipse.xtext.xbase.typesystem.internal.AbstractBatchTypeResolver.resolveTypes(AbstractBatchTypeResolver.java:69)
at org.eclipse.xtext.xbase.resource.BatchLinkingService.resolveBatched(BatchLinkingService.java:71)
at org.eclipse.xtext.xbase.resource.BatchLinkableResource.resolveLazyCrossReferences(BatchLinkableResource.java:165)
at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:500)
at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.postParse(XtextDocumentReconcileStrategy.java:175)
at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.doReconcile(XtextDocumentReconcileStrategy.java:153)
at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(XtextDocumentReconcileStrategy.java:67)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.doRun(XtextReconciler.java:449)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.access$3(XtextReconciler.java:429)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:363)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:1)
at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:37)
at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:91)
at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:428)
at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:162)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(XtextReconciler.java:360)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
The IdWithKey Extention Error line is this:
superTypes += **package/path/to/class**.IdWithKey.typeRef
[Updated on: Thu, 05 July 2018 12:00] Report message to a moderator
|
|
|
|
|
|
|
Re: Inheritance from non-grammar java class [message #1791827 is a reply to message #1791816] |
Thu, 05 July 2018 16:27 |
|
why do you have 3 inferrer classes: JvmTypeReferenceBuilder is not meant to be injected in a non main inferrer class.
otherwise it will not be initialized correctly.
=>
def dispatch void infer(IdWithKeyElement element, IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase) {
createExtendable(element, acceptor, isPreIndexingPhase, _typeReferenceBuilder)
}
@Extension public JvmTypeReferenceBuilder _typeReferenceBuilder;
@Inject extension JvmTypesBuilder
@Inject extension GeneratorHelperExtension
def void createExtendable(IdWithKeyElement element, IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase, JvmTypeReferenceBuilder _typeReferenceBuilder) {
this._typeReferenceBuilder = _typeReferenceBuilder;
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05467 seconds