|
24 | 24 | import java.util.Iterator; |
25 | 25 | import java.util.List; |
26 | 26 |
|
| 27 | +import static org.jd.core.v1.model.javasyntax.declaration.Declaration.*; |
| 28 | + |
27 | 29 | public class CompilationUnitVisitor extends StatementVisitor { |
28 | 30 | public static final KeywordToken ABSTRACT = new KeywordToken("abstract"); |
29 | 31 | public static final KeywordToken ANNOTATION = new KeywordToken("@interface"); |
@@ -54,10 +56,10 @@ public CompilationUnitVisitor(Loader loader, String mainInternalTypeName, Import |
54 | 56 |
|
55 | 57 | @Override |
56 | 58 | public void visit(AnnotationDeclaration declaration) { |
57 | | - if ((declaration.getFlags() & (Declaration.FLAG_SYNTHETIC | Declaration.FLAG_BRIDGE)) == 0) { |
| 59 | + if ((declaration.getFlags() & (FLAG_SYNTHETIC | FLAG_BRIDGE)) == 0) { |
58 | 60 | fragments.add(StartMovableJavaBlockFragment.START_MOVABLE_TYPE_BLOCK); |
59 | 61 |
|
60 | | - buildFragmentsForTypeDeclaration(declaration, declaration.getFlags() & ~Declaration.FLAG_ABSTRACT, ANNOTATION); |
| 62 | + buildFragmentsForTypeDeclaration(declaration, declaration.getFlags() & ~FLAG_ABSTRACT, ANNOTATION); |
61 | 63 |
|
62 | 64 | fragments.addTokensFragment(tokens); |
63 | 65 |
|
@@ -207,7 +209,7 @@ public void visit(BodyDeclaration declaration) { |
207 | 209 |
|
208 | 210 | @Override |
209 | 211 | public void visit(ClassDeclaration declaration) { |
210 | | - if ((declaration.getFlags() & (Declaration.FLAG_SYNTHETIC | Declaration.FLAG_BRIDGE)) == 0) { |
| 212 | + if ((declaration.getFlags() & (FLAG_SYNTHETIC | FLAG_BRIDGE)) == 0) { |
211 | 213 | fragments.add(StartMovableJavaBlockFragment.START_MOVABLE_TYPE_BLOCK); |
212 | 214 |
|
213 | 215 | buildFragmentsForClassOrInterfaceDeclaration(declaration, declaration.getFlags(), CLASS); |
@@ -318,7 +320,7 @@ public void visit(CompilationUnit compilationUnit) { |
318 | 320 |
|
319 | 321 | @Override |
320 | 322 | public void visit(ConstructorDeclaration declaration) { |
321 | | - if ((declaration.getFlags() & (Declaration.FLAG_SYNTHETIC|Declaration.FLAG_BRIDGE)) == 0) { |
| 323 | + if ((declaration.getFlags() & (FLAG_SYNTHETIC|FLAG_BRIDGE)) == 0) { |
322 | 324 | fragments.add(StartMovableJavaBlockFragment.START_MOVABLE_METHOD_BLOCK); |
323 | 325 |
|
324 | 326 | tokens = new Tokens(); |
@@ -463,7 +465,7 @@ public void visit(ElementValuePair reference) { |
463 | 465 |
|
464 | 466 | @Override |
465 | 467 | public void visit(EnumDeclaration declaration) { |
466 | | - if ((declaration.getFlags() & (Declaration.FLAG_SYNTHETIC | Declaration.FLAG_BRIDGE)) == 0) { |
| 468 | + if ((declaration.getFlags() & (FLAG_SYNTHETIC | FLAG_BRIDGE)) == 0) { |
467 | 469 | fragments.add(StartMovableJavaBlockFragment.START_MOVABLE_TYPE_BLOCK); |
468 | 470 |
|
469 | 471 | buildFragmentsForTypeDeclaration(declaration, declaration.getFlags(), ENUM); |
@@ -605,7 +607,7 @@ public void visit(ExpressionVariableInitializer declaration) { |
605 | 607 |
|
606 | 608 | @Override |
607 | 609 | public void visit(FieldDeclaration declaration) { |
608 | | - if ((declaration.getFlags() & (Declaration.FLAG_SYNTHETIC | Declaration.FLAG_BRIDGE)) == 0) { |
| 610 | + if ((declaration.getFlags() & (FLAG_SYNTHETIC | FLAG_BRIDGE)) == 0) { |
609 | 611 | fragments.add(StartMovableJavaBlockFragment.START_MOVABLE_FIELD_BLOCK); |
610 | 612 |
|
611 | 613 | tokens = new Tokens(); |
@@ -755,10 +757,10 @@ public void visit(InstanceInitializerDeclaration declaration) { |
755 | 757 |
|
756 | 758 | @Override |
757 | 759 | public void visit(InterfaceDeclaration declaration) { |
758 | | - if ((declaration.getFlags() & (Declaration.FLAG_SYNTHETIC | Declaration.FLAG_BRIDGE)) == 0) { |
| 760 | + if ((declaration.getFlags() & (FLAG_SYNTHETIC | FLAG_BRIDGE)) == 0) { |
759 | 761 | fragments.add(StartMovableJavaBlockFragment.START_MOVABLE_TYPE_BLOCK); |
760 | 762 |
|
761 | | - buildFragmentsForClassOrInterfaceDeclaration(declaration, declaration.getFlags() & ~Declaration.FLAG_ABSTRACT, INTERFACE); |
| 763 | + buildFragmentsForClassOrInterfaceDeclaration(declaration, declaration.getFlags() & ~FLAG_ABSTRACT, INTERFACE); |
762 | 764 |
|
763 | 765 | tokens.add(StartBlockToken.START_DECLARATION_OR_STATEMENT_BLOCK); |
764 | 766 |
|
@@ -882,7 +884,7 @@ public void visit(MemberDeclarations list) { |
882 | 884 |
|
883 | 885 | @Override |
884 | 886 | public void visit(MethodDeclaration declaration) { |
885 | | - if ((declaration.getFlags() & (Declaration.FLAG_SYNTHETIC | Declaration.FLAG_BRIDGE)) == 0) { |
| 887 | + if ((declaration.getFlags() & (FLAG_SYNTHETIC | FLAG_BRIDGE)) == 0) { |
886 | 888 | fragments.add(StartMovableJavaBlockFragment.START_MOVABLE_METHOD_BLOCK); |
887 | 889 |
|
888 | 890 | tokens = new Tokens(); |
@@ -1083,41 +1085,41 @@ protected void buildFragmentsForClassOrInterfaceDeclaration(InterfaceDeclaration |
1083 | 1085 | } |
1084 | 1086 |
|
1085 | 1087 | protected void buildTokensForAccessFlags(int flags) { |
1086 | | - if ((flags & Declaration.FLAG_PUBLIC) != 0) { |
| 1088 | + if ((flags & FLAG_PUBLIC) != 0) { |
1087 | 1089 | tokens.add(PUBLIC); |
1088 | 1090 | tokens.add(TextToken.SPACE); |
1089 | 1091 | } |
1090 | | - if ((flags & Declaration.FLAG_PRIVATE) != 0) { |
| 1092 | + if ((flags & FLAG_PRIVATE) != 0) { |
1091 | 1093 | tokens.add(PRIVATE); |
1092 | 1094 | tokens.add(TextToken.SPACE); |
1093 | 1095 | } |
1094 | | - if ((flags & Declaration.FLAG_PROTECTED) != 0) { |
| 1096 | + if ((flags & FLAG_PROTECTED) != 0) { |
1095 | 1097 | tokens.add(PROTECTED); |
1096 | 1098 | tokens.add(TextToken.SPACE); |
1097 | 1099 | } |
1098 | | - if ((flags & Declaration.FLAG_STATIC) != 0) { |
| 1100 | + if ((flags & FLAG_STATIC) != 0) { |
1099 | 1101 | tokens.add(STATIC); |
1100 | 1102 | tokens.add(TextToken.SPACE); |
1101 | 1103 | } |
1102 | | - if ((flags & Declaration.FLAG_FINAL) != 0) { |
| 1104 | + if ((flags & FLAG_FINAL) != 0) { |
1103 | 1105 | tokens.add(FINAL); |
1104 | 1106 | tokens.add(TextToken.SPACE); |
1105 | 1107 | } |
1106 | | - if ((flags & Declaration.FLAG_NATIVE) != 0) { |
| 1108 | + if ((flags & FLAG_NATIVE) != 0) { |
1107 | 1109 | tokens.add(NATIVE); |
1108 | 1110 | tokens.add(TextToken.SPACE); |
1109 | 1111 | } |
1110 | | - if ((flags & Declaration.FLAG_ABSTRACT) != 0) { |
| 1112 | + if ((flags & FLAG_ABSTRACT) != 0) { |
1111 | 1113 | tokens.add(ABSTRACT); |
1112 | 1114 | tokens.add(TextToken.SPACE); |
1113 | 1115 | } |
1114 | | - if ((flags & Declaration.FLAG_BRIDGE) != 0) { |
| 1116 | + if ((flags & FLAG_BRIDGE) != 0) { |
1115 | 1117 | tokens.add(StartMarkerToken.COMMENT); |
1116 | 1118 | tokens.add(COMMENT_BRIDGE); |
1117 | 1119 | tokens.add(EndMarkerToken.COMMENT); |
1118 | 1120 | tokens.add(TextToken.SPACE); |
1119 | 1121 | } |
1120 | | - if ((flags & Declaration.FLAG_SYNTHETIC) != 0) { |
| 1122 | + if ((flags & FLAG_SYNTHETIC) != 0) { |
1121 | 1123 | tokens.add(StartMarkerToken.COMMENT); |
1122 | 1124 | tokens.add(COMMENT_SYNTHETIC); |
1123 | 1125 | tokens.add(EndMarkerToken.COMMENT); |
|
0 commit comments