Community
Participate
Working Groups
java.lang.ClassCastException: org.eclipse.xtext.common.types.impl.JvmOperationImpl cannot be cast to org.eclipse.xtext.common.types.JvmConstructor at org.eclipse.xtext.xbase.impl.XConstructorCallImpl.getConstructor(XConstructorCallImpl.java:150) at org.eclipse.xtext.xbase.validation.XbaseJavaValidator.checkInstantiationOfAbstractClass(XbaseJavaValidator.java:640) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)
1) Input files in two open editors: class XtendClass { new() { new Entity() } } === entity Entity {} 2) Edit the dmodel file with the entity and add an operation: entity Entity { op name () : String { "" } } 3) Hit save The validator kicks in an revalidates the xtend class after it unloaded the referenced dmodel. Proxy resolution will lead to the CCE because of the index based URI fragments.
Happens with two Xtend classes, too. Start with: class OtherClass { def getName() { "" } } class XtendClass { new() { new OtherClass() } } And add a constructor to OtherClass: class OtherClass { def getName() { "" } new () { } }
works now
Requested via bug 522520. -M.