Community
Participate
Working Groups
I'm attaching a project with three java files. one is an interface with the @model tag. As the project stands right clicking on the Example.genmodel and selecting reload locates the file (It is called Example). However, move either one of the two java files that are in the main project (not part of the build path) into the test package and the reload will no longer work. This is the case for files like the anywhere within the project. If the enum is defined as its own class in its own file that is fine. It only breaks things when it is within another class. The assert also breaks things. This is not new. I've been fighting this since version 2.0.1. I filed a bad bug report earlier but didn't have time to provide a good one. Let me know if this is enough information for you.
Created attachment 24964 [details] Example of the bug. See the first entry of my report to make the bug manifest move either of the java files into the test package and reloading the genmodel will not work.
Jesse, EMF is using JDOM and JDOM doesn't support Java 5.0 syntax. We will migrate EMF to use AST as part of EMF 2.2 development: https://bugs.eclipse.org/bugs/show_bug.cgi?id=78076 The assert problem appears to be purely a JDOM problem: java.lang.ClassCastException: org/eclipse/jdt/internal/core/jdom/DOMMethod incompatible with org/eclipse/jdt/core/jdom/IDOMType at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at java.lang.ClassCastException.<init>(ClassCastException.java:54) at org.eclipse.jdt.internal.core.jdom.DOMBuilder.createType(DOMBuilder.java:271) at org.eclipse.jdt.core.jdom.DOMFactory.createType(DOMFactory.java:158) at org.eclipse.jdt.internal.core.jdom.DOMType.getDetailedNode(DOMType.java:392) at org.eclipse.jdt.internal.core.jdom.DOMNode.becomeDetailed(DOMNode.java:390) at org.eclipse.jdt.internal.core.jdom.DOMMember.getComment(DOMMember.java:218) at org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analyzeType(JavaEcoreBuilder.java:692) It may be something the JDT folks are still willing to fix (even though JDOM is deprecated). I'll transfer this bugzilla to them for consideration.
For the assert problem, there is nothing we can do. The JDOM parser is using the workspace preferences. So the workaround is to change the workspace compiler options to compliance 1.4 and source 1.4. We cannot change this without adding a new API. I will investigate the enum case.
The problem comes from the fact that the JDOM API doesn't know anything about 1.5 constructs. The API is deprecated and therefore has not been moved to 1.5 for the 3.1 delivery. DOM/AST has been provided to replace JDOM with a complete support for 1.5. EMF should move to DOM/AST in order to resolve this issue. Moving back to EMF
The best we can do is to return null.
Olivier, Thanks for the prompt assessment! I'll return this as a duplicate of the existing bugzilla for migrating from JDOM to AST. *** This bug has been marked as a duplicate of 78076 ***
No problem. I will add a new bug report against JDT/Core to improve thw actual behavior on 1.5 code. See bug 104371.
The bugzilla 78076, as a plan item, was broken in 2 steps. This bugzilla should be marked as a duplicate of 124372 which refers to enabling JMerge to work with Java5 code.
*** This bug has been marked as a duplicate of 124372 ***