Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Is it a bug of Xtext(when the reference target is deleted, an exception will be thrown out some times)
icon5.gif  Is it a bug of Xtext [message #690703] Thu, 30 June 2011 03:42 Go to next message
Kevin Sun is currently offline Kevin SunFriend
Messages: 32
Registered: August 2010
Location: China
Member

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)

Re: Is it a bug of Xtext [message #690739 is a reply to message #690703] Thu, 30 June 2011 05:58 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
That bug has been fixed in 2.0.
Please use the latest version.

Sven

Am 6/30/11 5:42 AM, schrieb Kevin Sun:
> 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)
>
>


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Is it a bug of Xtext [message #690746 is a reply to message #690739] Thu, 30 June 2011 06:45 Go to previous message
Kevin Sun is currently offline Kevin SunFriend
Messages: 32
Registered: August 2010
Location: China
Member

thx Sven Very Happy
Previous Topic:problems with the itemis indigo distribution
Next Topic:XtextResource.save(outputStream,options) throw a Exception
Goto Forum:
  


Current Time: Fri Apr 26 23:58:29 GMT 2024

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

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

Back to the top