@@ -56,7 +56,7 @@ public CompilationUnitVisitor(Loader loader, String mainInternalTypeName, int ma
5656
5757 @ Override
5858 public void visit (AnnotationDeclaration declaration ) {
59- if ((declaration .getFlags () & ( FLAG_SYNTHETIC | FLAG_BRIDGE ) ) == 0 ) {
59+ if ((declaration .getFlags () & FLAG_SYNTHETIC ) == 0 ) {
6060 fragments .add (StartMovableJavaBlockFragment .START_MOVABLE_TYPE_BLOCK );
6161
6262 buildFragmentsForTypeDeclaration (declaration , declaration .getFlags () & ~FLAG_ABSTRACT , ANNOTATION );
@@ -209,7 +209,7 @@ public void visit(BodyDeclaration declaration) {
209209
210210 @ Override
211211 public void visit (ClassDeclaration declaration ) {
212- if ((declaration .getFlags () & ( FLAG_SYNTHETIC | FLAG_BRIDGE ) ) == 0 ) {
212+ if ((declaration .getFlags () & FLAG_SYNTHETIC ) == 0 ) {
213213 fragments .add (StartMovableJavaBlockFragment .START_MOVABLE_TYPE_BLOCK );
214214
215215 buildFragmentsForClassOrInterfaceDeclaration (declaration , declaration .getFlags (), CLASS );
@@ -336,7 +336,7 @@ public void visit(ConstructorDeclaration declaration) {
336336 }
337337
338338 // Build tokens for access
339- buildTokensForAccessFlags (declaration .getFlags ());
339+ buildTokensForMethodAccessFlags (declaration .getFlags ());
340340
341341 // Build tokens for type parameters
342342 BaseTypeParameter typeParameters = declaration .getTypeParameters ();
@@ -465,7 +465,7 @@ public void visit(ElementValuePair reference) {
465465
466466 @ Override
467467 public void visit (EnumDeclaration declaration ) {
468- if ((declaration .getFlags () & ( FLAG_SYNTHETIC | FLAG_BRIDGE ) ) == 0 ) {
468+ if ((declaration .getFlags () & FLAG_SYNTHETIC ) == 0 ) {
469469 fragments .add (StartMovableJavaBlockFragment .START_MOVABLE_TYPE_BLOCK );
470470
471471 buildFragmentsForTypeDeclaration (declaration , declaration .getFlags (), ENUM );
@@ -607,7 +607,7 @@ public void visit(ExpressionVariableInitializer declaration) {
607607
608608 @ Override
609609 public void visit (FieldDeclaration declaration ) {
610- if ((declaration .getFlags () & ( FLAG_SYNTHETIC | FLAG_BRIDGE ) ) == 0 ) {
610+ if ((declaration .getFlags () & FLAG_SYNTHETIC ) == 0 ) {
611611 fragments .add (StartMovableJavaBlockFragment .START_MOVABLE_FIELD_BLOCK );
612612
613613 tokens = new Tokens ();
@@ -623,7 +623,7 @@ public void visit(FieldDeclaration declaration) {
623623 }
624624
625625 // Build tokens for access
626- buildTokensForAccessFlags (declaration .getFlags ());
626+ buildTokensForFieldAccessFlags (declaration .getFlags ());
627627 declaration .getType ().accept (this );
628628
629629 tokens .add (StartBlockToken .START_DECLARATION_OR_STATEMENT_BLOCK );
@@ -757,7 +757,7 @@ public void visit(InstanceInitializerDeclaration declaration) {
757757
758758 @ Override
759759 public void visit (InterfaceDeclaration declaration ) {
760- if ((declaration .getFlags () & ( FLAG_SYNTHETIC | FLAG_BRIDGE ) ) == 0 ) {
760+ if ((declaration .getFlags () & FLAG_SYNTHETIC ) == 0 ) {
761761 fragments .add (StartMovableJavaBlockFragment .START_MOVABLE_TYPE_BLOCK );
762762
763763 buildFragmentsForClassOrInterfaceDeclaration (declaration , declaration .getFlags () & ~FLAG_ABSTRACT , INTERFACE );
@@ -1085,7 +1085,7 @@ public void visit(MethodDeclaration declaration) {
10851085 }
10861086
10871087 // Build tokens for access
1088- buildTokensForAccessFlags (declaration .getFlags ());
1088+ buildTokensForMethodAccessFlags (declaration .getFlags ());
10891089
10901090 // Build tokens for type parameters
10911091 BaseTypeParameter typeParameters = declaration .getTypeParameters ();
@@ -1248,7 +1248,7 @@ protected void buildFragmentsForTypeDeclaration(TypeDeclaration declaration, int
12481248 }
12491249
12501250 // Build tokens for access
1251- buildTokensForAccessFlags (flags );
1251+ buildTokensForTypeAccessFlags (flags );
12521252 tokens .add (keyword );
12531253 tokens .add (TextToken .SPACE );
12541254
@@ -1269,21 +1269,50 @@ protected void buildFragmentsForClassOrInterfaceDeclaration(InterfaceDeclaration
12691269 }
12701270 }
12711271
1272- protected void buildTokensForAccessFlags (int flags ) {
1272+ protected void buildTokensForTypeAccessFlags (int flags ) {
12731273 if ((flags & FLAG_PUBLIC ) != 0 ) {
12741274 tokens .add (PUBLIC );
12751275 tokens .add (TextToken .SPACE );
12761276 }
1277+ if ((flags & FLAG_PROTECTED ) != 0 ) {
1278+ tokens .add (PROTECTED );
1279+ tokens .add (TextToken .SPACE );
1280+ }
12771281 if ((flags & FLAG_PRIVATE ) != 0 ) {
12781282 tokens .add (PRIVATE );
12791283 tokens .add (TextToken .SPACE );
12801284 }
1285+ if ((flags & FLAG_STATIC ) != 0 ) {
1286+ tokens .add (STATIC );
1287+ tokens .add (TextToken .SPACE );
1288+ }
1289+ if ((flags & FLAG_FINAL ) != 0 ) {
1290+ tokens .add (FINAL );
1291+ tokens .add (TextToken .SPACE );
1292+ }
1293+ if ((flags & FLAG_ABSTRACT ) != 0 ) {
1294+ tokens .add (ABSTRACT );
1295+ tokens .add (TextToken .SPACE );
1296+ }
1297+ if ((flags & FLAG_SYNTHETIC ) != 0 ) {
1298+ tokens .add (StartMarkerToken .COMMENT );
1299+ tokens .add (COMMENT_SYNTHETIC );
1300+ tokens .add (EndMarkerToken .COMMENT );
1301+ tokens .add (TextToken .SPACE );
1302+ }
1303+ }
1304+
1305+ protected void buildTokensForFieldAccessFlags (int flags ) {
1306+ if ((flags & FLAG_PUBLIC ) != 0 ) {
1307+ tokens .add (PUBLIC );
1308+ tokens .add (TextToken .SPACE );
1309+ }
12811310 if ((flags & FLAG_PROTECTED ) != 0 ) {
12821311 tokens .add (PROTECTED );
12831312 tokens .add (TextToken .SPACE );
12841313 }
1285- if ((flags & FLAG_DEFAULT ) != 0 ) {
1286- tokens .add (DEFAULT );
1314+ if ((flags & FLAG_PRIVATE ) != 0 ) {
1315+ tokens .add (PRIVATE );
12871316 tokens .add (TextToken .SPACE );
12881317 }
12891318 if ((flags & FLAG_STATIC ) != 0 ) {
@@ -1294,12 +1323,45 @@ protected void buildTokensForAccessFlags(int flags) {
12941323 tokens .add (FINAL );
12951324 tokens .add (TextToken .SPACE );
12961325 }
1297- if ((flags & FLAG_NATIVE ) != 0 ) {
1298- tokens .add (NATIVE );
1326+ if ((flags & FLAG_VOLATILE ) != 0 ) {
1327+ tokens .add (VOLATILE );
12991328 tokens .add (TextToken .SPACE );
13001329 }
1301- if ((flags & FLAG_ABSTRACT ) != 0 ) {
1302- tokens .add (ABSTRACT );
1330+ if ((flags & FLAG_TRANSIENT ) != 0 ) {
1331+ tokens .add (TRANSIENT );
1332+ tokens .add (TextToken .SPACE );
1333+ }
1334+ if ((flags & FLAG_SYNTHETIC ) != 0 ) {
1335+ tokens .add (StartMarkerToken .COMMENT );
1336+ tokens .add (COMMENT_SYNTHETIC );
1337+ tokens .add (EndMarkerToken .COMMENT );
1338+ tokens .add (TextToken .SPACE );
1339+ }
1340+ }
1341+
1342+ protected void buildTokensForMethodAccessFlags (int flags ) {
1343+ if ((flags & FLAG_PUBLIC ) != 0 ) {
1344+ tokens .add (PUBLIC );
1345+ tokens .add (TextToken .SPACE );
1346+ }
1347+ if ((flags & FLAG_PROTECTED ) != 0 ) {
1348+ tokens .add (PROTECTED );
1349+ tokens .add (TextToken .SPACE );
1350+ }
1351+ if ((flags & FLAG_PRIVATE ) != 0 ) {
1352+ tokens .add (PRIVATE );
1353+ tokens .add (TextToken .SPACE );
1354+ }
1355+ if ((flags & FLAG_STATIC ) != 0 ) {
1356+ tokens .add (STATIC );
1357+ tokens .add (TextToken .SPACE );
1358+ }
1359+ if ((flags & FLAG_FINAL ) != 0 ) {
1360+ tokens .add (FINAL );
1361+ tokens .add (TextToken .SPACE );
1362+ }
1363+ if ((flags & FLAG_SYNCHRONIZED ) != 0 ) {
1364+ tokens .add (SYNCHRONIZED );
13031365 tokens .add (TextToken .SPACE );
13041366 }
13051367 if ((flags & FLAG_BRIDGE ) != 0 ) {
@@ -1308,12 +1370,28 @@ protected void buildTokensForAccessFlags(int flags) {
13081370 tokens .add (EndMarkerToken .COMMENT );
13091371 tokens .add (TextToken .SPACE );
13101372 }
1373+ if ((flags & FLAG_NATIVE ) != 0 ) {
1374+ tokens .add (NATIVE );
1375+ tokens .add (TextToken .SPACE );
1376+ }
1377+ if ((flags & FLAG_ABSTRACT ) != 0 ) {
1378+ tokens .add (ABSTRACT );
1379+ tokens .add (TextToken .SPACE );
1380+ }
1381+ if ((flags & FLAG_STRICT ) != 0 ) {
1382+ tokens .add (STRICT );
1383+ tokens .add (TextToken .SPACE );
1384+ }
13111385 if ((flags & FLAG_SYNTHETIC ) != 0 ) {
13121386 tokens .add (StartMarkerToken .COMMENT );
13131387 tokens .add (COMMENT_SYNTHETIC );
13141388 tokens .add (EndMarkerToken .COMMENT );
13151389 tokens .add (TextToken .SPACE );
13161390 }
1391+ if ((flags & FLAG_DEFAULT ) != 0 ) {
1392+ tokens .add (DEFAULT );
1393+ tokens .add (TextToken .SPACE );
1394+ }
13171395 }
13181396
13191397 protected class AnnotationVisitor extends AbstractJavaSyntaxVisitor {
0 commit comments