Summary: | All ASTNodes that deal with modifiers should offer a method setModifiers(List modifiers) | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
Component: | Core | Assignee: | Jim des Rivieres <jeem> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | martinae |
Version: | 3.0 | ||
Target Milestone: | 3.1 M1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Dirk Baeumer
2004-07-05 13:41:59 EDT
Jim, Do you want to add this API? Me and Dirk had a lengthy discussion about the topic and Dirk still couldn't convince me that 'setModifiers' is a good idea. I think ASTNode.copySubtrees would do the job -> newDecl.modifiers().addAll( ASTNode.copySubtrees(newAST, oldDecl.modifiers())); But in general I agree with Dirk that working with modifiers got quite nasty with the AST-3 and we should think about if we can add a bit more convenience for working with the modifier nodes. A first suggestion from my side would be an addition to ast.newModifier ast.newModifiers(int modifierFlags) : List creating modifier nodes from a bitSet (in a default order) Martin, I agree that setModifiers does not seem like much of a value-add. I like the idea of adding a convenience method for creating modifier nodes from modifier bit flags, and automatically arranging them in JLS-recommended order. Added convenience methods to AST: public List newModifiers(int flags); Added tests. Updated build notes. Released to HEAD. Dirk/Martin, Please reopen if there are additional things that could make JLS3 modifiers more useable. |