--- old/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-03-15 16:16:42.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-03-15 16:16:42.000000000 -0700 @@ -4009,8 +4009,7 @@ // Enums may not be extended by source-level classes if (st.tsym != null && ((st.tsym.flags_field & Flags.ENUM) != 0) && - ((c.flags_field & (Flags.ENUM | Flags.COMPOUND)) == 0) && - !target.compilerBootstrap(c)) { + ((c.flags_field & (Flags.ENUM | Flags.COMPOUND)) == 0)) { log.error(env.tree.pos(), "enum.types.not.extensible"); } attribClassBody(env, c); --- old/src/share/classes/com/sun/tools/javac/comp/Lower.java 2013-03-15 16:16:43.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/comp/Lower.java 2013-03-15 16:16:43.000000000 -0700 @@ -2604,11 +2604,6 @@ enumDefs.appendList(otherDefs.toList()); tree.defs = enumDefs.toList(); - - // Add the necessary members for the EnumCompatibleMode - if (target.compilerBootstrap(tree.sym)) { - addEnumCompatibleMembers(tree); - } } // where private MethodSymbol systemArraycopyMethod; @@ -2657,30 +2652,6 @@ olderasure.getReturnType(), olderasure.getThrownTypes(), syms.methodClass); - - if (target.compilerBootstrap(m.owner)) { - // Initialize synthetic name field - Symbol nameVarSym = lookupSynthetic(names.fromString("$name"), - tree.sym.owner.members()); - JCIdent nameIdent = make.Ident(nameParam.sym); - JCIdent id1 = make.Ident(nameVarSym); - JCAssign newAssign = make.Assign(id1, nameIdent); - newAssign.type = id1.type; - JCExpressionStatement nameAssign = make.Exec(newAssign); - nameAssign.type = id1.type; - tree.body.stats = tree.body.stats.prepend(nameAssign); - - // Initialize synthetic ordinal field - Symbol ordinalVarSym = lookupSynthetic(names.fromString("$ordinal"), - tree.sym.owner.members()); - JCIdent ordIdent = make.Ident(ordParam.sym); - id1 = make.Ident(ordinalVarSym); - newAssign = make.Assign(id1, ordIdent); - newAssign.type = id1.type; - JCExpressionStatement ordinalAssign = make.Exec(newAssign); - ordinalAssign.type = id1.type; - tree.body.stats = tree.body.stats.prepend(ordinalAssign); - } } JCMethodDecl prevMethodDef = currentMethodDef; --- old/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java 2013-03-15 16:16:43.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java 2013-03-15 16:16:43.000000000 -0700 @@ -473,44 +473,6 @@ null, //make.Block(0, Tree.emptyList.prepend(make.Return(make.Ident(names._null)))), null); memberEnter(valueOf, env); - - // the remaining members are for bootstrapping only - if (!target.compilerBootstrap(tree.sym)) return; - - // public final int ordinal() { return ???; } - JCMethodDecl ordinal = make.at(tree.pos). - MethodDef(make.Modifiers(Flags.PUBLIC|Flags.FINAL), - names.ordinal, - make.Type(syms.intType), - List.nil(), - List.nil(), - List.nil(), - null, - null); - memberEnter(ordinal, env); - - // public final String name() { return ???; } - JCMethodDecl name = make. - MethodDef(make.Modifiers(Flags.PUBLIC|Flags.FINAL), - names._name, - make.Type(syms.stringType), - List.nil(), - List.nil(), - List.nil(), - null, - null); - memberEnter(name, env); - - // public int compareTo(E other) { return ???; } - MethodSymbol compareTo = new - MethodSymbol(Flags.PUBLIC, - names.compareTo, - new MethodType(List.of(tree.sym.type), - syms.intType, - List.nil(), - syms.methodClass), - tree.sym); - memberEnter(make.MethodDef(compareTo, null), env); } public void visitTopLevel(JCCompilationUnit tree) { @@ -936,7 +898,7 @@ Type supertype = (tree.extending != null) ? attr.attribBase(tree.extending, baseEnv, true, false, true) - : ((tree.mods.flags & Flags.ENUM) != 0 && !target.compilerBootstrap(c)) + : ((tree.mods.flags & Flags.ENUM) != 0) ? attr.attribBase(enumBase(tree.pos, c), baseEnv, true, false, false) : (c.fullname == names.java_lang_Object) @@ -949,16 +911,6 @@ ListBuffer all_interfaces = null; // lazy init Set interfaceSet = new HashSet(); List interfaceTrees = tree.implementing; - if ((tree.mods.flags & Flags.ENUM) != 0 && target.compilerBootstrap(c)) { - // add interface Comparable - interfaceTrees = - interfaceTrees.prepend(make.Type(new ClassType(syms.comparableType.getEnclosingType(), - List.of(c.type), - syms.comparableType.tsym))); - // add interface Serializable - interfaceTrees = - interfaceTrees.prepend(make.Type(syms.serializableType)); - } for (JCExpression iface : interfaceTrees) { Type i = attr.attribBase(iface, baseEnv, false, true, true); if (i.hasTag(CLASS)) { @@ -1401,8 +1353,7 @@ if (c.type != syms.objectType) stats = stats.prepend(SuperCall(make, typarams, params, based)); if ((c.flags() & ENUM) != 0 && - (types.supertype(c.type).tsym == syms.enumSym || - target.compilerBootstrap(c))) { + (types.supertype(c.type).tsym == syms.enumSym)) { // constructors of true enums are private flags = (flags & ~AccessFlags) | PRIVATE | GENERATEDCONSTR; } else --- old/src/share/classes/com/sun/tools/javac/jvm/Target.java 2013-03-15 16:16:43.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/jvm/Target.java 2013-03-15 16:16:43.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,17 +48,6 @@ /** J2SE1.4 = Merlin. */ JDK1_4("1.4", 48, 0), - /** Support for the JSR14 prototype compiler (targeting 1.4 VMs - * augmented with a few support classes). This is a transitional - * option that will not be supported in the product. */ - JSR14("jsr14", 48, 0), - - /** The following are undocumented transitional targets that we - * had used to test VM fixes in update releases. We do not - * promise to retain support for them. */ - JDK1_4_1("1.4.1", 48, 0), - JDK1_4_2("1.4.2", 48, 0), - /** Tiger. */ JDK1_5("1.5", 49, 0), @@ -175,23 +164,23 @@ return compareTo(JDK1_5) >= 0; } - /** Beginning in -target 1.4.2, we make synthetic variables + /** Beginning in -target 1.5, we make synthetic variables * package-private instead of private. This is to prevent the * necessity of access methods, which effectively relax the * protection of the field but bloat the class files and affect * execution. */ public boolean usePrivateSyntheticFields() { - return compareTo(JDK1_4_2) < 0; + return compareTo(JDK1_5) < 0; } /** Sometimes we need to create a field to cache a value like a - * class literal of the assertions flag. In -target 1.4.2 and + * class literal of the assertions flag. In -target 1.5 and * later we create a new synthetic class for this instead of * using the outermost class. See 4401576. */ public boolean useInnerCacheClass() { - return compareTo(JDK1_4_2) >= 0; + return compareTo(JDK1_5) >= 0; } /** Return true if cldc-style stack maps need to be generated. */ @@ -276,7 +265,7 @@ * See 4468823 */ public boolean classLiteralsNoInit() { - return compareTo(JDK1_4_2) >= 0; + return compareTo(JDK1_5) >= 0; } /** Although we may not have support for class literals, when we @@ -300,22 +289,10 @@ return compareTo(JDK1_5) >= 0; } - /** For bootstrapping javac only, we do without java.lang.Enum if - * necessary. - */ - public boolean compilerBootstrap(Symbol c) { - return - this == JSR14 && - (c.flags() & Flags.ENUM) != 0 && - c.flatName().toString().startsWith("com.sun.tools.") - // && !Target.class.getSuperclass().getName().equals("java.lang.Enum") - ; - } - /** In J2SE1.5.0, we introduced the "EnclosingMethod" attribute * for improved reflection support. */ public boolean hasEnclosingMethodAttribute() { - return compareTo(JDK1_5) >= 0 || this == JSR14; + return compareTo(JDK1_5) >= 0; } } --- old/test/tools/javac/ClassFileModifiers/MemberModifiers.java 2013-03-15 16:16:45.000000000 -0700 +++ new/test/tools/javac/ClassFileModifiers/MemberModifiers.java 2013-03-15 16:16:45.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 4249112 4785453 * @summary Verify that implicit member modifiers are set correctly. * - * @compile/ref=MemberModifiers.out -source 1.4 -target 1.4.2 -Xlint:-options -XDdumpmodifiers=cfm MemberModifiers.java + * @compile/ref=MemberModifiers.out -source 1.4 -target 1.5 -Xlint:-options -XDdumpmodifiers=cfm MemberModifiers.java */ // Currently, we check only that members of final classes are not final. --- old/test/tools/javac/profiles/ProfileOptionTest.java 2013-03-15 16:16:46.000000000 -0700 +++ new/test/tools/javac/profiles/ProfileOptionTest.java 2013-03-15 16:16:46.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -106,7 +106,6 @@ for (Target t: Target.values()) { switch (t) { case JDK1_1: case JDK1_2: // no equivalent -source - case JDK1_4_1: case JDK1_4_2: case JSR14: // transitional values continue; }