- if (this.anonymousTypes != null && fieldDeclaration.initialization == null) {
- for (int i = 0; i < this.anonymousTypeCount; i++){
- if (anonymousTypes[i].preserveContent){
- fieldDeclaration.initialization = this.anonymousTypes[i].updatedTypeDeclaration().allocation;
+ if (this.anonymousTypes != null) {
+ if(fieldDeclaration.initialization == null) {
+ for (int i = 0; i < this.anonymousTypeCount; i++){
+ if (anonymousTypes[i].preserveContent){
+ fieldDeclaration.initialization = this.anonymousTypes[i].updatedTypeDeclaration().allocation;
+ }
+ }
+ if (this.anonymousTypeCount > 0) fieldDeclaration.bits |= ASTNode.HasLocalTypeMASK;
+ } else if(fieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
+ // fieldDeclaration is an enum constant
+ for (int i = 0; i < this.anonymousTypeCount; i++){
+ if (anonymousTypes[i].preserveContent){
+ this.anonymousTypes[i].updatedTypeDeclaration();
+ }