Community
Participate
Working Groups
Build Identifier: I20110603-0909 while editing files with many imports a ClassCastException occurs if linking is triggered. It seems to be dependent on import resolution (this is at least what I understand from stacktrace). It is unclear which cast causes this exception because the WrappedException don't give further information about the class (don't print the error message of ClassCastException). Sadly, I was unable to identify if a specific import causes this error. Once the error occurs I am unable to edit the file. Even element deletion and copy causes this error. It seems that one of the casts from a EcoreUtil.getAllContents(...) to a specific type is the cause. It would be nice to make these casts typesafe and add the error message to the wrapper exception. Best Regards, Florian Quadt additional build info: - happens sometimes in 2.0.1 - happens a lot in Nightly 2.0.1.v201108151710 for big files at some point - I cannot check newer versions because of other issues -------------- stacktrace: -------------- org.eclipse.xtext.linking.lazy.LazyLinkingResource - resolution of uriFragment 'xtextLink_::0.1.6.12.4.0.0.6.0.1.6::0::/2' failed. java.lang.ClassCastException . An internal error occurred during: "Updating editor state". org.eclipse.emf.common.util.WrappedException: java.lang.ClassCastException at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:206) at org.eclipse.xtext.xtend2.resource.Xtend2Resource.getEObject(Xtend2Resource.java:75) at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:143) at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:104) at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:435) at org.eclipse.xtext.resource.impl.DefaultResourceDescription.getImportedNames(DefaultResourceDescription.java:95) at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.getImportedNames(DefaultResourceDescriptionManager.java:99) at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.isAffected(DefaultResourceDescriptionManager.java:95) at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.isReparseRequired(DirtyStateEditorSupport.java:425) at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(DirtyStateEditorSupport.java:124) at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(DirtyStateEditorSupport.java:1) at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32) at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:86) at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob.run(DirtyStateEditorSupport.java:117) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: java.lang.ClassCastException Reproducible: Sometimes Steps to Reproduce: I have no idea how to reproduce this error. It occurs on some xtend files, but they have nothing in common, except long lists of imports 1. create a xtend-file 2. add some import statement (xtend and java) 3. edit the file
Did you truncate the stacktrace?
(In reply to comment #1) > Did you truncate the stacktrace? No. That's all what I have. While editing the file a Eclipse ErrorDialog opens that doesn't contain useful information except something like "ClassCastException". I got the stacktrace from the eclipseErrorLog and that's all I have.
Could you please set a breakpoint in the exception handler of LazyLinkingResource.getEObject and add the stack of the class cast exception here?
(In reply to comment #3) > Could you please set a breakpoint in the exception handler of > LazyLinkingResource.getEObject and add the stack of the class cast exception > here? Hi Sebastian, since the latest stable the ClassCastException does not happen anymore. I cannot guarantee that this is fixed, since this error only occurs infrequently. But I hope it disappeared. So I change to "resolved fixed" and will reopen if it happens again. Thanks for your assistance, Florian
Closing all bugs that were set to RESOLVED before Neon.0