@@ -201,6 +201,12 @@ public boolean visit(AnonymousClassDeclaration node) {
201
201
if (needPreparation ) {
202
202
break ;
203
203
}
204
+ } else if (element instanceof Initializer ) {
205
+ Initializer init = (Initializer ) element ;
206
+ if ((init .getModifiers () & Modifier .STATIC ) == 0 ) {
207
+ needPreparation = true ;
208
+ break ;
209
+ }
204
210
}
205
211
}
206
212
@@ -302,6 +308,11 @@ public boolean visit(AnonymousClassDeclaration node) {
302
308
continue ;
303
309
}
304
310
element .accept (this );
311
+ } else if (element instanceof Initializer ) {
312
+ Initializer init = (Initializer ) element ;
313
+ if ((init .getModifiers () & Modifier .STATIC ) == 0 ) {
314
+ element .accept (this );
315
+ }
305
316
}
306
317
}
307
318
buffer .append ("});\r \n " );
@@ -672,6 +683,12 @@ public void endVisit(EnumDeclaration node) {
672
683
if (needPreparation ) {
673
684
break ;
674
685
}
686
+ } else if (element instanceof Initializer ) {
687
+ Initializer init = (Initializer ) element ;
688
+ if ((init .getModifiers () & Modifier .STATIC ) == 0 ) {
689
+ needPreparation = true ;
690
+ break ;
691
+ }
675
692
}
676
693
}
677
694
if (needPreparation ) {
@@ -684,6 +701,11 @@ public void endVisit(EnumDeclaration node) {
684
701
continue ;
685
702
}
686
703
element .accept (this );
704
+ } else if (element instanceof Initializer ) {
705
+ Initializer init = (Initializer ) element ;
706
+ if ((init .getModifiers () & Modifier .STATIC ) == 0 ) {
707
+ element .accept (this );
708
+ }
687
709
}
688
710
}
689
711
buffer .append ("};\r \n " );
@@ -2208,6 +2230,12 @@ public void endVisit(TypeDeclaration node) {
2208
2230
if (needPreparation ) {
2209
2231
break ;
2210
2232
}
2233
+ } else if (element instanceof Initializer ) {
2234
+ Initializer init = (Initializer ) element ;
2235
+ if ((init .getModifiers () & Modifier .STATIC ) == 0 ) {
2236
+ needPreparation = true ;
2237
+ break ;
2238
+ }
2211
2239
}
2212
2240
}
2213
2241
if (needPreparation ) {
@@ -2220,6 +2248,11 @@ public void endVisit(TypeDeclaration node) {
2220
2248
continue ;
2221
2249
}
2222
2250
element .accept (this );
2251
+ } else if (element instanceof Initializer ) {
2252
+ Initializer init = (Initializer ) element ;
2253
+ if ((init .getModifiers () & Modifier .STATIC ) == 0 ) {
2254
+ element .accept (this );
2255
+ }
2223
2256
}
2224
2257
}
2225
2258
buffer .append ("});\r \n " );
@@ -2256,7 +2289,11 @@ public void endVisit(TypeDeclaration node) {
2256
2289
buffer .append (");\r \n " );
2257
2290
staticCount = -1 ;
2258
2291
}
2259
- element .accept (this );
2292
+ if ((((Initializer ) element ).getModifiers () & Modifier .STATIC ) != 0 ) {
2293
+ element .accept (this );
2294
+ } else {
2295
+ continue ; // ignore here
2296
+ }
2260
2297
} else if (element instanceof FieldDeclaration ) {
2261
2298
FieldDeclaration field = (FieldDeclaration ) element ;
2262
2299
if ((field .getModifiers () & Modifier .STATIC ) != 0 ) {
0 commit comments