Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v retrieving revision 1.83 diff -u -r1.83 CodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 21 Oct 2004 13:34:46 -0000 1.83 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 28 Oct 2004 20:25:30 -0000 @@ -1887,11 +1887,13 @@ Label loopCond = new Label(this); Label loopStart = new Label(this); Label wrongConstant = new Label(this); - + this.getstatic(enumValuesSyntheticfield); this.dup(); this.astore_1(); this.arraylength(); + this.iconst_1(); + this.isub(); this.istore_2(); this.goto_(loopCond); loopStart.place(); @@ -1901,6 +1903,7 @@ this.aaload(); this.dup(); this.astore_3(); + this.invokeJavaLangEnumname(this.classFile.referenceBinding); this.invokeStringEquals(); this.ifeq(wrongConstant); this.aload_3(); @@ -1909,7 +1912,7 @@ this.iinc(2, -1); loopCond.place(); this.iload_2(); - this.ifgt(loopStart); + this.ifge(loopStart); this.newJavaLangIllegalArgumentException(); this.dup(); this.aload_0(); @@ -3307,7 +3310,17 @@ QualifiedNamesConstants.Init, QualifiedNamesConstants.DefaultConstructorSignature); } - +public void invokeJavaLangEnumname(TypeBinding typeBinding) { + // invokevirtual: java.lang.Enum.name()String + if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Enum.name()Ljava/lang/String;"); //$NON-NLS-1$ + this.invoke( + OPC_invokevirtual, + 0, + 1, + typeBinding.constantPoolName(), + QualifiedNamesConstants.Name, + QualifiedNamesConstants.NameSignature); +} public void invokeJavaLangIllegalArgumentExceptionStringConstructor() { // invokespecial: java.lang.IllegalArgumentException.(String)V if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.IllegalArgumentException.(java.lang.String)V"); //$NON-NLS-1$ Index: compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java,v retrieving revision 1.22 diff -u -r1.22 QualifiedNamesConstants.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java 21 Oct 2004 13:34:46 -0000 1.22 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/QualifiedNamesConstants.java 28 Oct 2004 20:25:30 -0000 @@ -192,4 +192,6 @@ char[] LONGVALUE_LONG_METHOD_SIGNATURE = "()J".toCharArray(); //$NON-NLS-1$ char[] GETDECLAREDCONSTRUCTOR_NAME = "getDeclaredConstructor".toCharArray(); //$NON-NLS-1$ char[] GETDECLAREDCONSTRUCTOR_SIGNATURE = "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;".toCharArray(); //$NON-NLS-1$ + char[] Name = "name".toCharArray(); //$NON-NLS-1$ + char[] NameSignature = "()Ljava/lang/String;".toCharArray(); //$NON-NLS-1$ }