Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Invalidating the builder state
Invalidating the builder state [message #757482] Fri, 18 November 2011 15:24 Go to next message
Mark Christiaens is currently offline Mark ChristiaensFriend
Messages: 63
Registered: October 2010
Member
I was wondering whether the builder state (so ../.metadata/.plugins/org.eclipse.xtext.builder/builder.state) is validated when Xtext starts? I suspect not. I think that, when you've changed your grammar, some parts of the builder state can still refer to old and removed fields of your previous grammar implementation.

I'm bringing this up because we've noticed that after upgrading to a slightly modified grammar we see (before doing a first clean) stack traces like:
  BugReport [
 version=2.1.1.201111171651
 pluginName=org.eclipse.core.jobs
 pluginVersion=3.5.100.v20110404
 stacktrace=
       at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eStructuralFeature(BasicEObjectImpl.java:739)
       at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentSegment(BasicEObjectImpl.java:557)
       at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:780)
       at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:756)
       at org.eclipse.xtext.resource.XtextResource.access$1(XtextResource.java:1)
       at org.eclipse.xtext.resource.XtextResource$1.getEObject(XtextResource.java:102)
       at org.eclipse.xtext.resource.DefaultFragmentProvider.getEObject(DefaultFragmentProvider.java:26)
       at org.eclipse.xtext.resource.XtextResource.getEObject(XtextResource.java:286)
       at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:282)
       at org.eclipse.xtext.ui.editor.occurrences.DefaultOccurrenceComputer$1.exec(DefaultOccurrenceComputer.java:115)
       at org.eclipse.xtext.ui.editor.occurrences.DefaultOccurrenceComputer$1.exec(DefaultOccurrenceComputer.java:1)
       at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
       at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:78)
       at org.eclipse.xtext.ui.editor.occurrences.DefaultOccurrenceComputer.createAnnotationMap(DefaultOccurrenceComputer.java:86)
       at com.sigasi.hdt.vhdl.ui.editor.VhdlOccurrenceComputer.createAnnotationMap(VhdlOccurrenceComputer.java:19)
       at org.eclipse.xtext.ui.editor.occurrences.OccurrenceMarker$MarkOccurrenceJob.run(OccurrenceMarker.java:122)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

 message=An internal error occurred during: "Mark Occurrences".
]

!ENTRY org.eclipse.core.jobs 4 2 2011-11-18 10:27:21.723
!MESSAGE An internal error occurred during: "Mark Occurrences".
!STACK 0
java.lang.IllegalArgumentException: The feature 'subtype' is not a valid feature
       at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eStructuralFeature(BasicEObjectImpl.java:739)
       at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentSegment(BasicEObjectImpl.java:557)
       at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:780)
       at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:756)
       at org.eclipse.xtext.resource.XtextResource.access$1(XtextResource.java:1)
       at org.eclipse.xtext.resource.XtextResource$1.getEObject(XtextResource.java:102)
       at org.eclipse.xtext.resource.DefaultFragmentProvider.getEObject(DefaultFragmentProvider.java:26)
       at org.eclipse.xtext.resource.XtextResource.getEObject(XtextResource.java:286)
       at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:282)
       at org.eclipse.xtext.ui.editor.occurrences.DefaultOccurrenceComputer$1.exec(DefaultOccurrenceComputer.java:115)
       at org.eclipse.xtext.ui.editor.occurrences.DefaultOccurrenceComputer$1.exec(DefaultOccurrenceComputer.java:1)
       at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
       at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:78)
       at org.eclipse.xtext.ui.editor.occurrences.DefaultOccurrenceComputer.createAnnotationMap(DefaultOccurrenceComputer.java:86)
       at com.sigasi.hdt.vhdl.ui.editor.VhdlOccurrenceComputer.createAnnotationMap(VhdlOccurrenceComputer.java:19)
       at org.eclipse.xtext.ui.editor.occurrences.OccurrenceMarker$MarkOccurrenceJob.run(OccurrenceMarker.java:122)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


The above code is failing to find the 'subtype' feature in an EMF object. That is one of the fields in our grammar that we renamed to 'type'.

When we clean the project, the error disappears. That makes sense: cleaning re-initializes the builder state.
----
Mark Christiaens
Discover the Future of VHDL Design
Go to www.sigasi.com
Re: Invalidating the builder state [message #757488 is a reply to message #757482] Fri, 18 November 2011 15:58 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13765
Registered: July 2009
Senior Member
Hi,

yes you are right. see EMFBasedPersister

Regards
Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Compiling a larger grammar takes forever
Next Topic:Errors set in JavaValidator don't appear in the generation
Goto Forum:
  


Current Time: Thu Mar 04 00:35:09 GMT 2021

Powered by FUDForum. Page generated in 0.01569 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top