Community
Participate
Working Groups
(This is in 3.1 M2.) The org.eclipse.jdt.core.dom.CompilationUnit instance corresponding to the class Foo below has no "public" modifier, although it should. Note that if the declaration is simplified to just "@Jpf.Controller public class Foo {...}", then the instance does have a "public" modifier. @Jpf.Controller( catches={ @Jpf.Catch(type=java.lang.Exception.class, method="handleException"), @Jpf.Catch(type=PageFlowException.class, method="handlePageFlowException") } ) public class Foo { ... }
Below is the code I used to determine if the class in the description is public. The code returns false when it should return true for that class. (Apologies for any errors in the code: I had to collapse together some scattered methods, and may have made a mistake.) ICompilationUnit cu = JavaCore.createCompilationUnitFrom(file); ASTParser parser = ASTParser.newParser(AST.JLS3); parser.setSource(cu); CompilationUnit cuNode = (CompilationUnit) parser.createAST(null); TypeDeclaration type = (TypeDeclaration) cuNode.types().get(0); return Modifier.isPublic(type.getModifiers());
Fixed and released in HEAD. Regression test added.
Verified for 3.1M3 with build I20041102