diff -r c78acf6c2f3e -r fcf89720ae71 src/share/classes/com/sun/tools/javac/code/TargetType.java --- a/src/share/classes/com/sun/tools/javac/code/TargetType.java Mon Dec 10 12:10:50 2012 +0000 +++ b/src/share/classes/com/sun/tools/javac/code/TargetType.java Mon Dec 10 16:21:26 2012 +0000 @@ -166,7 +166,7 @@ static final int MAXIMUM_TARGET_TYPE_VALUE = 0x22; private final int targetTypeValue; - private Set flags; + private final Set flags; TargetType(int targetTypeValue, TargetAttribute... attributes) { if (targetTypeValue < Byte.MIN_VALUE @@ -233,10 +233,10 @@ return this.targetTypeValue; } - private static TargetType[] targets = null; + private static final TargetType[] targets; - private static TargetType[] buildTargets() { - TargetType[] targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1]; + static { + targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1]; TargetType[] alltargets = values(); for (TargetType target : alltargets) { if (target.targetTypeValue >= 0) @@ -246,13 +246,9 @@ if (targets[i] == null) targets[i] = UNKNOWN; } - return targets; } public static boolean isValidTargetTypeValue(int tag) { - if (targets == null) - targets = buildTargets(); - if (((byte)tag) == ((byte)UNKNOWN.targetTypeValue)) return true; @@ -260,9 +256,6 @@ } public static TargetType fromTargetTypeValue(int tag) { - if (targets == null) - targets = buildTargets(); - if (((byte)tag) == ((byte)UNKNOWN.targetTypeValue)) return UNKNOWN;