View | Details | Raw Unified | Return to bug 331334 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ClassFile.java (+26 lines)
Lines 823-828 Link Here
823
					case SyntheticMethodBinding.SwitchTable :
823
					case SyntheticMethodBinding.SwitchTable :
824
						// generate a method info to define the switch table synthetic method
824
						// generate a method info to define the switch table synthetic method
825
						addSyntheticSwitchTable(syntheticMethod);
825
						addSyntheticSwitchTable(syntheticMethod);
826
						break;
827
					case SyntheticMethodBinding.TooManyEnumsConstants :
828
						addSyntheticEnumInitializationMethod(syntheticMethod);
826
				}
829
				}
827
			}
830
			}
828
		}
831
		}
Lines 918-923 Link Here
918
		this.contents[methodAttributeOffset] = (byte) attributeNumber;
921
		this.contents[methodAttributeOffset] = (byte) attributeNumber;
919
	}
922
	}
920
923
924
	public void addSyntheticEnumInitializationMethod(SyntheticMethodBinding methodBinding) {
925
		generateMethodInfoHeader(methodBinding);
926
		int methodAttributeOffset = this.contentsOffset;
927
		// this will add exception attribute, synthetic attribute, deprecated attribute,...
928
		int attributeNumber = generateMethodInfoAttributes(methodBinding);
929
		// Code attribute
930
		int codeAttributeOffset = this.contentsOffset;
931
		attributeNumber++; // add code attribute
932
		generateCodeAttributeHeader();
933
		this.codeStream.init(this);
934
		this.codeStream.generateSyntheticBodyForEnumInitializationMethod(methodBinding);
935
		completeCodeAttributeForSyntheticMethod(
936
			methodBinding,
937
			codeAttributeOffset,
938
			((SourceTypeBinding) methodBinding.declaringClass)
939
				.scope
940
				.referenceCompilationUnit()
941
				.compilationResult
942
				.getLineSeparatorPositions());
943
		// update the number of attributes
944
		this.contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);
945
		this.contents[methodAttributeOffset] = (byte) attributeNumber;
946
	}
921
	/**
947
	/**
922
	 * INTERNAL USE-ONLY
948
	 * INTERNAL USE-ONLY
923
	 * Generate the byte for a problem method info that correspond to a synthetic method that
949
	 * Generate the byte for a problem method info that correspond to a synthetic method that
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java (-7 / +40 lines)
Lines 26-31 Link Here
26
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
26
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
27
import org.eclipse.jdt.internal.compiler.lookup.MethodScope;
27
import org.eclipse.jdt.internal.compiler.lookup.MethodScope;
28
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
28
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
29
import org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding;
29
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
30
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
30
import org.eclipse.jdt.internal.compiler.parser.Parser;
31
import org.eclipse.jdt.internal.compiler.parser.Parser;
31
import org.eclipse.jdt.internal.compiler.problem.AbortMethod;
32
import org.eclipse.jdt.internal.compiler.problem.AbortMethod;
Lines 191-206 Link Here
191
		// generate static fields/initializers/enum constants
192
		// generate static fields/initializers/enum constants
192
		final FieldDeclaration[] fieldDeclarations = declaringType.fields;
193
		final FieldDeclaration[] fieldDeclarations = declaringType.fields;
193
		BlockScope lastInitializerScope = null;
194
		BlockScope lastInitializerScope = null;
195
		int remainingFieldCount = 0;
194
		if (TypeDeclaration.kind(declaringType.modifiers) == TypeDeclaration.ENUM_DECL) {
196
		if (TypeDeclaration.kind(declaringType.modifiers) == TypeDeclaration.ENUM_DECL) {
195
			int enumCount = 0;
197
			int enumCount = declaringType.enumConstantsCounter;
196
			int remainingFieldCount = 0;
198
			if (enumCount > 2000) {
197
			if (fieldDeclarations != null) {
199
				// generate synthetic methods to initialize all the enum constants
200
				int begin = -1;
201
				int count = 0;
202
				if (fieldDeclarations != null) {
203
					int max = fieldDeclarations.length;
204
					for (int i = 0; i < max; i++) {
205
						FieldDeclaration fieldDecl = fieldDeclarations[i];
206
						if (fieldDecl.isStatic()) {
207
							if (fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
208
								if (begin == -1) {
209
									begin = i;
210
								}
211
								count++;
212
								if (count > 2000) {
213
									SyntheticMethodBinding syntheticMethod = declaringType.binding.addSyntheticMethodForEnumInitialization(begin, i);
214
									codeStream.invoke(Opcodes.OPC_invokestatic, syntheticMethod, null /* default declaringClass */);
215
									begin = -1;
216
									count = 0;
217
								}
218
							}
219
						}
220
					}
221
					if (count != 0) {
222
						// add last synthetic method
223
						SyntheticMethodBinding syntheticMethod = declaringType.binding.addSyntheticMethodForEnumInitialization(begin, max);
224
						codeStream.invoke(Opcodes.OPC_invokestatic, syntheticMethod, null /* default declaringClass */);
225
					}
226
				}
227
			} else if (fieldDeclarations != null) {
198
				for (int i = 0, max = fieldDeclarations.length; i < max; i++) {
228
				for (int i = 0, max = fieldDeclarations.length; i < max; i++) {
199
					FieldDeclaration fieldDecl = fieldDeclarations[i];
229
					FieldDeclaration fieldDecl = fieldDeclarations[i];
200
					if (fieldDecl.isStatic()) {
230
					if (fieldDecl.isStatic()) {
201
						if (fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
231
						if (fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
202
							fieldDecl.generateCode(staticInitializerScope, codeStream);
232
							fieldDecl.generateCode(staticInitializerScope, codeStream);
203
							enumCount++;
204
						} else {
233
						} else {
205
							remainingFieldCount++;
234
							remainingFieldCount++;
206
						}
235
						}
Lines 228-247 Link Here
228
			codeStream.fieldAccess(Opcodes.OPC_putstatic, declaringType.enumValuesSyntheticfield, null /* default declaringClass */);
257
			codeStream.fieldAccess(Opcodes.OPC_putstatic, declaringType.enumValuesSyntheticfield, null /* default declaringClass */);
229
			if (remainingFieldCount != 0) {
258
			if (remainingFieldCount != 0) {
230
				// if fields that are not enum constants need to be generated (static initializer/static field)
259
				// if fields that are not enum constants need to be generated (static initializer/static field)
231
				for (int i = 0, max = fieldDeclarations.length; i < max; i++) {
260
				for (int i = 0, max = fieldDeclarations.length; i < max && remainingFieldCount >= 0; i++) {
232
					FieldDeclaration fieldDecl = fieldDeclarations[i];
261
					FieldDeclaration fieldDecl = fieldDeclarations[i];
233
					switch (fieldDecl.getKind()) {
262
					switch (fieldDecl.getKind()) {
234
						case AbstractVariableDeclaration.ENUM_CONSTANT :
263
						case AbstractVariableDeclaration.ENUM_CONSTANT :
235
							break;
264
							break;
236
						case AbstractVariableDeclaration.INITIALIZER :
265
						case AbstractVariableDeclaration.INITIALIZER :
237
							if (!fieldDecl.isStatic())
266
							if (!fieldDecl.isStatic()) {
238
								break;
267
								break;
268
							}
269
							remainingFieldCount--;
239
							lastInitializerScope = ((Initializer) fieldDecl).block.scope;
270
							lastInitializerScope = ((Initializer) fieldDecl).block.scope;
240
							fieldDecl.generateCode(staticInitializerScope, codeStream);
271
							fieldDecl.generateCode(staticInitializerScope, codeStream);
241
							break;
272
							break;
242
						case AbstractVariableDeclaration.FIELD :
273
						case AbstractVariableDeclaration.FIELD :
243
							if (!fieldDecl.binding.isStatic())
274
							if (!fieldDecl.binding.isStatic()) {
244
								break;
275
								break;
276
							}
277
							remainingFieldCount--;
245
							lastInitializerScope = null;
278
							lastInitializerScope = null;
246
							fieldDecl.generateCode(staticInitializerScope, codeStream);
279
							fieldDecl.generateCode(staticInitializerScope, codeStream);
247
							break;
280
							break;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java (-1 / +1 lines)
Lines 94-100 Link Here
94
	int pc = codeStream.position;
94
	int pc = codeStream.position;
95
	boolean isStatic;
95
	boolean isStatic;
96
	if (this.initialization != null
96
	if (this.initialization != null
97
		&& !((isStatic = this.binding.isStatic()) && this.binding.constant() != Constant.NotAConstant)) {
97
			&& !((isStatic = this.binding.isStatic()) && this.binding.constant() != Constant.NotAConstant)) {
98
		// non-static field, need receiver
98
		// non-static field, need receiver
99
		if (!isStatic)
99
		if (!isStatic)
100
			codeStream.aload_0();
100
			codeStream.aload_0();
(-)compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java (+1 lines)
Lines 55-60 Link Here
55
	public TypeDeclaration enclosingType; // for member types only
55
	public TypeDeclaration enclosingType; // for member types only
56
56
57
	public FieldBinding enumValuesSyntheticfield; 	// for enum
57
	public FieldBinding enumValuesSyntheticfield; 	// for enum
58
	public int enumConstantsCounter;
58
59
59
	// 1.5 support
60
	// 1.5 support
60
	public TypeParameter[] typeParameters;
61
	public TypeParameter[] typeParameters;
(-)compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java (-1 / +21 lines)
Lines 15-24 Link Here
15
import org.eclipse.jdt.internal.compiler.CompilationResult;
15
import org.eclipse.jdt.internal.compiler.CompilationResult;
16
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
16
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
17
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
17
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
18
import org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration;
18
import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
19
import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
19
import org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
20
import org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
20
import org.eclipse.jdt.internal.compiler.ast.Expression;
21
import org.eclipse.jdt.internal.compiler.ast.Expression;
22
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
21
import org.eclipse.jdt.internal.compiler.ast.OperatorIds;
23
import org.eclipse.jdt.internal.compiler.ast.OperatorIds;
24
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
22
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
25
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
23
import org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
26
import org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
24
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
27
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
Lines 2445-2451 Link Here
2445
	aload_2();
2448
	aload_2();
2446
	areturn();
2449
	areturn();
2447
}
2450
}
2448
2451
public void generateSyntheticBodyForEnumInitializationMethod(SyntheticMethodBinding methodBinding) {
2452
	// no local used
2453
	this.maxLocals = 0;
2454
	// generate all enum constants
2455
	SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) methodBinding.declaringClass;
2456
	TypeDeclaration typeDeclaration = sourceTypeBinding.scope.referenceContext;
2457
	BlockScope staticInitializerScope = typeDeclaration.staticInitializerScope;
2458
	FieldDeclaration[] fieldDeclarations = typeDeclaration.fields;
2459
	for (int i = methodBinding.startIndex, max = methodBinding.endIndex; i < max; i++) {
2460
		FieldDeclaration fieldDecl = fieldDeclarations[i];
2461
		if (fieldDecl.isStatic()) {
2462
			if (fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
2463
				fieldDecl.generateCode(staticInitializerScope, this);
2464
			}
2465
		}
2466
	}
2467
	return_();
2468
}
2449
public void generateSyntheticBodyForFieldReadAccess(SyntheticMethodBinding accessMethod) {
2469
public void generateSyntheticBodyForFieldReadAccess(SyntheticMethodBinding accessMethod) {
2450
	initializeMaxLocals(accessMethod);
2470
	initializeMaxLocals(accessMethod);
2451
	FieldBinding fieldBinding = accessMethod.targetReadField;
2471
	FieldBinding fieldBinding = accessMethod.targetReadField;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java (-1 / +12 lines)
Lines 480-485 Link Here
480
	}
480
	}
481
	return accessMethod;
481
	return accessMethod;
482
}
482
}
483
public SyntheticMethodBinding addSyntheticMethodForEnumInitialization(int begin, int end) {
484
	if (this.synthetics == null)
485
		this.synthetics = new HashMap[MAX_SYNTHETICS];
486
	if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null)
487
		this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5);
488
489
	SyntheticMethodBinding accessMethod = new SyntheticMethodBinding(this, begin, end);
490
	SyntheticMethodBinding[] accessors = new SyntheticMethodBinding[2]; 
491
	this.synthetics[SourceTypeBinding.METHOD_EMUL].put(accessMethod.selector, accessors);
492
	accessors[0] = accessMethod;
493
	return accessMethod;
494
}
483
/* Add a new synthetic access method for access to <targetMethod>.
495
/* Add a new synthetic access method for access to <targetMethod>.
484
 * Must distinguish access method used for super access from others (need to use invokespecial bytecode)
496
 * Must distinguish access method used for super access from others (need to use invokespecial bytecode)
485
	Answer the new method or the existing method if one already existed.
497
	Answer the new method or the existing method if one already existed.
Lines 1500-1506 Link Here
1500
public ReferenceBinding[] superInterfaces() {
1512
public ReferenceBinding[] superInterfaces() {
1501
	return this.superInterfaces;
1513
	return this.superInterfaces;
1502
}
1514
}
1503
1504
public SyntheticMethodBinding[] syntheticMethods() {
1515
public SyntheticMethodBinding[] syntheticMethods() {
1505
	if (this.synthetics == null 
1516
	if (this.synthetics == null 
1506
			|| this.synthetics[SourceTypeBinding.METHOD_EMUL] == null 
1517
			|| this.synthetics[SourceTypeBinding.METHOD_EMUL] == null 
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java (-1 / +26 lines)
Lines 21-29 Link Here
21
	public FieldBinding targetWriteField;		// write access to a field
21
	public FieldBinding targetWriteField;		// write access to a field
22
	public MethodBinding targetMethod;			// method or constructor
22
	public MethodBinding targetMethod;			// method or constructor
23
	public TypeBinding targetEnumType; 			// enum type
23
	public TypeBinding targetEnumType; 			// enum type
24
24
	
25
	public int purpose;
25
	public int purpose;
26
26
27
	// fields used to generate enum constants when too many
28
	public int startIndex;
29
	public int endIndex;
30
27
	public final static int FieldReadAccess = 1; 		// field read
31
	public final static int FieldReadAccess = 1; 		// field read
28
	public final static int FieldWriteAccess = 2; 		// field write
32
	public final static int FieldWriteAccess = 2; 		// field write
29
	public final static int SuperFieldReadAccess = 3; // super field read
33
	public final static int SuperFieldReadAccess = 3; // super field read
Lines 35-40 Link Here
35
	public final static int EnumValues = 9; // enum #values()
39
	public final static int EnumValues = 9; // enum #values()
36
	public final static int EnumValueOf = 10; // enum #valueOf(String)
40
	public final static int EnumValueOf = 10; // enum #valueOf(String)
37
	public final static int SwitchTable = 11; // switch table method
41
	public final static int SwitchTable = 11; // switch table method
42
	public final static int TooManyEnumsConstants = 12; // too many enum constants
38
43
39
	public int sourceStart = 0; // start position of the matching declaration
44
	public int sourceStart = 0; // start position of the matching declaration
40
	public int index; // used for sorting access methods in the class file
45
	public int index; // used for sorting access methods in the class file
Lines 265-270 Link Here
265
		}
270
		}
266
	}
271
	}
267
	
272
	
273
	/**
274
	 * Construct enum special methods: values or valueOf methods
275
	 */
276
	public SyntheticMethodBinding(SourceTypeBinding declaringEnum, int startIndex, int endIndex) {
277
		this.declaringClass = declaringEnum;
278
		SyntheticMethodBinding[] knownAccessMethods = declaringEnum.syntheticMethods();
279
		this.index = knownAccessMethods == null ? 0 : knownAccessMethods.length;
280
		StringBuffer buffer = new StringBuffer();
281
		buffer.append(' ').append(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX).append(this.index);
282
		this.selector = String.valueOf(buffer).toCharArray(); 
283
		this.modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic;
284
		this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
285
		this.purpose = SyntheticMethodBinding.TooManyEnumsConstants;
286
		this.thrownExceptions = Binding.NO_EXCEPTIONS;
287
		this.returnType = TypeBinding.VOID;
288
		this.parameters = Binding.NO_PARAMETERS;
289
		this.startIndex = startIndex;
290
		this.endIndex = endIndex;
291
	}
292
268
	// Create a synthetic method that will simply call the super classes method.
293
	// Create a synthetic method that will simply call the super classes method.
269
	// Used when a public method is inherited from a non-public class into a public class.
294
	// Used when a public method is inherited from a non-public class into a public class.
270
	// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=288658
295
	// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=288658
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (-86 / +87 lines)
Lines 8277-8368 Link Here
8277
protected void dispatchDeclarationIntoEnumDeclaration(int length) {
8277
protected void dispatchDeclarationIntoEnumDeclaration(int length) {
8278
8278
8279
	if (length == 0)
8279
	if (length == 0)
8280
      return;
8280
		return;
8281
   int[] flag = new int[length + 1]; //plus one -- see <HERE>
8281
	int[] flag = new int[length + 1]; //plus one -- see <HERE>
8282
   int size1 = 0, size2 = 0, size3 = 0;
8282
	int size1 = 0, size2 = 0, size3 = 0;
8283
   TypeDeclaration enumDeclaration = (TypeDeclaration) this.astStack[this.astPtr - length];
8283
	TypeDeclaration enumDeclaration = (TypeDeclaration) this.astStack[this.astPtr - length];
8284
   boolean hasAbstractMethods = false;
8284
	boolean hasAbstractMethods = false;
8285
   for (int i = length - 1; i >= 0; i--) {
8285
	int enumConstantsCounter = 0;
8286
      ASTNode astNode = this.astStack[this.astPtr--];
8286
	for (int i = length - 1; i >= 0; i--) {
8287
      if (astNode instanceof AbstractMethodDeclaration) {
8287
		ASTNode astNode = this.astStack[this.astPtr--];
8288
         //methods and constructors have been regrouped into one single list
8288
		if (astNode instanceof AbstractMethodDeclaration) {
8289
         flag[i] = 2;
8289
			//methods and constructors have been regrouped into one single list
8290
         size2++;
8290
			flag[i] = 2;
8291
		if (((AbstractMethodDeclaration) astNode).isAbstract()) {
8291
			size2++;
8292
			hasAbstractMethods = true;
8292
			if (((AbstractMethodDeclaration) astNode).isAbstract()) {
8293
		}
8293
				hasAbstractMethods = true;
8294
      } else if (astNode instanceof TypeDeclaration) {
8294
			}
8295
         flag[i] = 3;
8295
		} else if (astNode instanceof TypeDeclaration) {
8296
         size3++;
8296
			flag[i] = 3;
8297
      } else if (astNode instanceof FieldDeclaration) {
8297
			size3++;
8298
         flag[i] = 1;
8298
		} else if (astNode instanceof FieldDeclaration) {
8299
         size1++;
8299
			flag[i] = 1;
8300
//         if(astNode instanceof EnumConstant) {
8300
			size1++;
8301
//            EnumConstant constant = (EnumConstant) astNode;
8301
			if (((FieldDeclaration) astNode).getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
8302
//            ((AllocationExpression)constant.initialization).type = new SingleTypeReference(enumDeclaration.name,
8302
				enumConstantsCounter++;
8303
//                  (((long) enumDeclaration.sourceStart) << 32) + enumDeclaration.sourceEnd);
8303
			}
8304
//         }
8304
		}
8305
      }
8305
	}
8306
   }
8306
8307
8307
	//arrays creation
8308
   //arrays creation
8308
	if (size1 != 0) {
8309
   if (size1 != 0) {
8309
		enumDeclaration.fields = new FieldDeclaration[size1];
8310
      enumDeclaration.fields = new FieldDeclaration[size1];
8310
	}
8311
   }
8311
	if (size2 != 0) {
8312
   if (size2 != 0) {
8312
		enumDeclaration.methods = new AbstractMethodDeclaration[size2];
8313
      enumDeclaration.methods = new AbstractMethodDeclaration[size2];
8313
		if (hasAbstractMethods) enumDeclaration.bits |= ASTNode.HasAbstractMethods;
8314
      if (hasAbstractMethods) enumDeclaration.bits |= ASTNode.HasAbstractMethods;
8314
	}
8315
   }
8315
	if (size3 != 0) {
8316
   if (size3 != 0) {
8316
		enumDeclaration.memberTypes = new TypeDeclaration[size3];
8317
      enumDeclaration.memberTypes = new TypeDeclaration[size3];
8317
	}
8318
   }
8318
8319
8319
	//arrays fill up
8320
   //arrays fill up
8320
	size1 = size2 = size3 = 0;
8321
   size1 = size2 = size3 = 0;
8321
	int flagI = flag[0], start = 0;
8322
   int flagI = flag[0], start = 0;
8322
	int length2;
8323
   int length2;
8323
	for (int end = 0; end <= length; end++) //<HERE> the plus one allows to
8324
   for (int end = 0; end <= length; end++) //<HERE> the plus one allows to
8324
	{
8325
      {
8325
		if (flagI != flag[end]) //treat the last element as a ended flag.....
8326
      if (flagI != flag[end]) //treat the last element as a ended flag.....
8326
		{ //array copy
8327
         { //array copy
8327
			switch (flagI) {
8328
         switch (flagI) {
8328
				case 1 :
8329
            case 1 :
8329
					size1 += (length2 = end - start);
8330
               size1 += (length2 = end - start);
8330
					System.arraycopy(
8331
               System.arraycopy(
8331
							this.astStack,
8332
                  this.astStack,
8332
							this.astPtr + start + 1,
8333
                  this.astPtr + start + 1,
8333
							enumDeclaration.fields,
8334
                  enumDeclaration.fields,
8334
							size1 - length2,
8335
                  size1 - length2,
8335
							length2);
8336
                  length2);
8336
					break;
8337
               break;
8337
				case 2 :
8338
            case 2 :
8338
					size2 += (length2 = end - start);
8339
               size2 += (length2 = end - start);
8339
					System.arraycopy(
8340
               System.arraycopy(
8340
							this.astStack,
8341
                  this.astStack,
8341
							this.astPtr + start + 1,
8342
                  this.astPtr + start + 1,
8342
							enumDeclaration.methods,
8343
                  enumDeclaration.methods,
8343
							size2 - length2,
8344
                  size2 - length2,
8344
							length2);
8345
                  length2);
8345
					break;
8346
               break;
8346
				case 3 :
8347
            case 3 :
8347
					size3 += (length2 = end - start);
8348
               size3 += (length2 = end - start);
8348
					System.arraycopy(
8349
               System.arraycopy(
8349
							this.astStack,
8350
                  this.astStack,
8350
							this.astPtr + start + 1,
8351
                  this.astPtr + start + 1,
8351
							enumDeclaration.memberTypes,
8352
                  enumDeclaration.memberTypes,
8352
							size3 - length2,
8353
                  size3 - length2,
8353
							length2);
8354
                  length2);
8354
					break;
8355
               break;
8355
			}
8356
         }
8356
			flagI = flag[start = end];
8357
         flagI = flag[start = end];
8357
		}
8358
      }
8358
	}
8359
   }
8359
8360
8360
	if (enumDeclaration.memberTypes != null) {
8361
   if (enumDeclaration.memberTypes != null) {
8361
		for (int i = enumDeclaration.memberTypes.length - 1; i >= 0; i--) {
8362
      for (int i = enumDeclaration.memberTypes.length - 1; i >= 0; i--) {
8362
			enumDeclaration.memberTypes[i].enclosingType = enumDeclaration;
8363
         enumDeclaration.memberTypes[i].enclosingType = enumDeclaration;
8363
		}
8364
      }
8364
	}
8365
   }}
8365
	enumDeclaration.enumConstantsCounter = enumConstantsCounter;
8366
}
8366
protected CompilationUnitDeclaration endParse(int act) {
8367
protected CompilationUnitDeclaration endParse(int act) {
8367
8368
8368
	this.lastAct = act;
8369
	this.lastAct = act;

Return to bug 331334