Community
Participate
Working Groups
This code demonstrates that calling getComment on an IDOMType will change the flags from correctly encoding the type as being interface to incorrectly encoding it (because during becomeDetailed() that information is lost): package org.example.jdom; import org.eclipse.core.runtime.IPlatformRunnable; import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.jdom.DOMFactory; import org.eclipse.jdt.core.jdom.IDOMCompilationUnit; import org.eclipse.jdt.core.jdom.IDOMType; public class Test implements IPlatformRunnable { public Object run(Object object) { DOMFactory factory = new DOMFactory(); IDOMCompilationUnit jCompilationUnit = factory.createCompilationUnit("package x; /** @model */ interface X {}", "NAME"); IDOMType jType = (IDOMType)jCompilationUnit.getFirstChild().getNextNode(); System.err.println("" + ((jType.getFlags() & Flags.AccInterface) != 0)); jType.getComment(); System.err.println("" + ((jType.getFlags() & Flags.AccInterface) != 0)); return new Integer(0); } } This bug completely breaks EMF's JavaEcoreBuilder, which is a blocking problem for our clients and hence we see this as a blocking problem.
Created attachment 15897 [details] Full project with test case. The attachment is a zip of the complete project for reproducing the problem.
I will investigate.
Should we consider for 3.0 maintenance backporting or is it only a blocker in 3.1 stream ?
This seems to be a problem only in 3.1 where the call to adjustInterfaceModifiers(); has been removed. The DocumentElementParser has not been updated. Fixing this resolves this issue. I will attach a patch soon.
The next nightly build will contain the fix.
Created attachment 15909 [details] Apply on HEAD This will be released as soon as all tests passed.
Fixed and released in HEAD. Regression test added in ASTConverterTestAST3_2.test0576
Thanks for the speedy service!!!
Verified (in I200412140010) that the test ensures that getComment() has no side effect on the flags.