Is it a bug of Xtext [message #690703] |
Thu, 30 June 2011 03:42 |
|
The editor I used is the Domain-Model in the Xtext examples.
the Xtext version is 1.0.2.v201102150722.
I have two files.
one is named model.dmodel, and the content is like this
//----------- model.dmodel ----- start------
package model {
import defs.*
entity Conference {
name : String
attendees : Person
speakers: Speaker
}
entity Person {
name : String
}
entity Speaker extends Person {
attrName : Conference
}
entity Session {
title: String
isTutorial : Bool
}
entity Datum extends Array{
}
}
//----------- model.dmodel ----- end------
the other is commonDataType.dmodel
//----------- commonDataType.dmodel ----- start------
package defs {
datatype String
datatype Bool
entity Array {
}
}
//----------- commonDataType.dmodel ----- end------
The step I follow is
1 open the file model.dmodel
2 ctrl+left_click the "String" (then the file commonDataType.dmodel will be opened and the cursor will stay at the line where the datatype String is defined)
3 delete the line of String definition
4 save the file
5 recover the change
6 save the file
maybe the exception will be thrown out. If not, repeat step 3-6 quickly several times, then you will get the exception.
the log is this
!ENTRY org.eclipse.core.jobs 4 2 2011-06-30 11:40:12.767
!MESSAGE An internal error occurred during: "Updating editor state".
!STACK 0
java.lang.ClassCastException: org.eclipse.xtext.example.domainmodel.impl.DataTypeImpl cannot be cast to org.eclipse.xtext.example.domainmodel.Entity
at org.eclipse.xtext.example.domainmodel.impl.EntityImpl.getSuperType(EntityImpl.java:94)
at org.eclipse.xtext.example.domainmodel.impl.EntityImpl.eGet(EntityImpl.java:168)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1021)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1013)
at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:409)
at org.eclipse.emf.ecore.util.EcoreUtil.resolveCrossReferences(EcoreUtil.java:307)
at org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:287)
at org.eclipse.xtext.resource.impl.DefaultResourceDescription.getImportedNames(DefaultResourceDescription.java:97)
at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.getImportedNames(DefaultResourceDescriptionManager.java:97)
at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.isAffected(DefaultResourceDescriptionManager.java:93)
at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.isReparseRequired(DirtyStateEditorSupport.java:354)
at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(DirtyStateEditorSupport.java:120)
at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(DirtyStateEditorSupport.java:1)
at org.eclipse.xtext.util.concurrent.IStateAccess$AbstractImpl.readOnly(IStateAccess.java:40)
at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:70)
at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob.run(DirtyStateEditorSupport.java:113)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03179 seconds