Skip to content
Permalink
Browse files
8264331: Use the blessed modifier order in jdk.compiler
Reviewed-by: vromero, iris, shade
  • Loading branch information
alblue authored and shipilev committed Apr 1, 2021
1 parent 0228734 commit d2df9a7df89f095a9f706d849177eb201ac8d1cf
Showing with 111 additions and 111 deletions.
  1. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskPool.java
  2. +4 −4 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
  3. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
  4. +6 −6 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
  5. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
  6. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
  7. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java
  8. +37 −37 src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java
  9. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
  10. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
  11. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java
  12. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
  13. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/parser/ReferenceParser.java
  14. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/parser/Tokens.java
  15. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java
  16. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java
  17. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java
  18. +3 −3 src/jdk.compiler/share/classes/com/sun/tools/javac/util/Bits.java
  19. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java
  20. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/util/IntHashTable.java
  21. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/util/Iterators.java
  22. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java
  23. +8 −8 src/jdk.compiler/share/classes/com/sun/tools/javac/util/LayoutCharacters.java
  24. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/util/SharedNameTable.java
  25. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java
  26. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
  27. +8 −8 src/jdk.compiler/share/classes/com/sun/tools/sjavac/Log.java
  28. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/sjavac/Package.java
  29. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/sjavac/Source.java
  30. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/PubapiVisitor.java
  31. +5 −5 src/jdk.compiler/share/classes/com/sun/tools/sjavac/pubapi/PubApi.java
  32. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFile.java
  33. +4 −4 src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFileMonitor.java
  34. +4 −4 src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java
@@ -360,7 +360,7 @@ public void started(TaskEvent e) {
*/
static class ReusableJavaCompiler extends JavaCompiler {

final static Factory<JavaCompiler> factory = ReusableJavaCompiler::new;
static final Factory<JavaCompiler> factory = ReusableJavaCompiler::new;

ReusableJavaCompiler(Context context) {
super(context);
@@ -387,7 +387,7 @@ protected void checkReusable() {
*/
static class ReusableLog extends Log {

final static Factory<Log> factory = ReusableLog::new;
static final Factory<Log> factory = ReusableLog::new;

Context context;

@@ -799,7 +799,7 @@ public TypeSymbol(Kind kind, long flags, Name name, Type type, Symbol owner) {
}
/** form a fully qualified name from a name and an owner
*/
static public Name formFullName(Name name, Symbol owner) {
public static Name formFullName(Name name, Symbol owner) {
if (owner == null) return name;
if ((owner.kind != ERR) &&
(owner.kind.matches(KindSelector.VAL_MTH) ||
@@ -814,7 +814,7 @@ static public Name formFullName(Name name, Symbol owner) {
/** form a fully qualified name from a name and an owner, after
* converting to flat representation
*/
static public Name formFlatName(Name name, Symbol owner) {
public static Name formFlatName(Name name, Symbol owner) {
if (owner == null || owner.kind.matches(KindSelector.VAL_MTH) ||
(owner.kind == TYP && owner.type.hasTag(TYPEVAR))
) return name;
@@ -2470,7 +2470,7 @@ public int getAccessCode(Tag tag) {
this.tag = tag;
}

static public AccessCode getFromCode(int code) {
public static AccessCode getFromCode(int code) {
for (AccessCode aCodes : AccessCode.values()) {
if (aCodes.code == code) {
return aCodes;
@@ -2512,7 +2512,7 @@ static int from(Tag tag, int opcode) {
/** Dummy completer to be used when the symbol has been completed or
* does not need completion.
*/
public final static Completer NULL_COMPLETER = new Completer() {
public static final Completer NULL_COMPLETER = new Completer() {
public void complete(Symbol sym) { }
public boolean isTerminal() { return true; }
};
@@ -375,7 +375,7 @@ public Type stripMetadata() {
return accept(stripMetadata, null);
}
//where
private final static TypeMapping<Void> stripMetadata = new StructuralTypeMapping<Void>() {
private static final TypeMapping<Void> stripMetadata = new StructuralTypeMapping<Void>() {
@Override
public Type visitClassType(ClassType t, Void aVoid) {
return super.visitClassType((ClassType)t.typeNoMetadata(), aVoid);
@@ -1063,10 +1063,10 @@ private void checkUnsafeVarargsConversion(Type t, Type s, Warner warn) {
* Is t a subtype of s?<br>
* (not defined for Method and ForAll types)
*/
final public boolean isSubtype(Type t, Type s) {
public final boolean isSubtype(Type t, Type s) {
return isSubtype(t, s, true);
}
final public boolean isSubtypeNoCapture(Type t, Type s) {
public final boolean isSubtypeNoCapture(Type t, Type s) {
return isSubtype(t, s, false);
}
public boolean isSubtype(Type t, Type s, boolean capture) {
@@ -4895,7 +4895,7 @@ public String toString() {
* Void if a second argument is not needed.
*/
public static abstract class DefaultTypeVisitor<R,S> implements Type.Visitor<R,S> {
final public R visit(Type t, S s) { return t.accept(this, s); }
public final R visit(Type t, S s) { return t.accept(this, s); }
public R visitClassType(ClassType t, S s) { return visitType(t, s); }
public R visitWildcardType(WildcardType t, S s) { return visitType(t, s); }
public R visitArrayType(ArrayType t, S s) { return visitType(t, s); }
@@ -4922,7 +4922,7 @@ public String toString() {
* Void if a second argument is not needed.
*/
public static abstract class DefaultSymbolVisitor<R,S> implements Symbol.Visitor<R,S> {
final public R visit(Symbol s, S arg) { return s.accept(this, arg); }
public final R visit(Symbol s, S arg) { return s.accept(this, arg); }
public R visitClassSymbol(ClassSymbol s, S arg) { return visitSymbol(s, arg); }
public R visitMethodSymbol(MethodSymbol s, S arg) { return visitSymbol(s, arg); }
public R visitOperatorSymbol(OperatorSymbol s, S arg) { return visitSymbol(s, arg); }
@@ -4975,7 +4975,7 @@ public R visitUndetVar(UndetVar t, S s) {
* visitor; use Void if no return type is needed.
*/
public static abstract class UnaryVisitor<R> extends SimpleVisitor<R,Void> {
final public R visit(Type t) { return t.accept(this, null); }
public final R visit(Type t) { return t.accept(this, null); }
}

/**
@@ -4989,7 +4989,7 @@ public R visitUndetVar(UndetVar t, S s) {
* not needed.
*/
public static class MapVisitor<S> extends DefaultTypeVisitor<Type,S> {
final public Type visit(Type t) { return t.accept(this, null); }
public final Type visit(Type t) { return t.accept(this, null); }
public Type visitType(Type t, S s) { return t; }
}

@@ -356,7 +356,7 @@ final DeferredTypeCompleter completer() {
}

@Override
final public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
public final Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
Assert.check(dt == this);
if (deferredAttrContext.mode == AttrMode.SPECULATIVE) {
Type t = (resultInfo.pt == Type.recoveryType) ?
@@ -2062,7 +2062,7 @@ Type condType(List<DiagnosticPosition> positions, List<Type> condTypes) {
.collect(List.collector()));
}

final static TypeTag[] primitiveTags = new TypeTag[]{
static final TypeTag[] primitiveTags = new TypeTag[]{
BYTE,
CHAR,
SHORT,
@@ -95,7 +95,7 @@

/** A switch to determine whether we check for package/class conflicts
*/
final static boolean checkClash = true;
static final boolean checkClash = true;

private final Names names;
private final Enter enter;
@@ -64,45 +64,45 @@
* deletion without notice.</b> */
public class ClassFile {

public final static int JAVA_MAGIC = 0xCAFEBABE;
public static final int JAVA_MAGIC = 0xCAFEBABE;

// see Target
public final static int CONSTANT_Utf8 = 1;
public final static int CONSTANT_Unicode = 2;
public final static int CONSTANT_Integer = 3;
public final static int CONSTANT_Float = 4;
public final static int CONSTANT_Long = 5;
public final static int CONSTANT_Double = 6;
public final static int CONSTANT_Class = 7;
public final static int CONSTANT_String = 8;
public final static int CONSTANT_Fieldref = 9;
public final static int CONSTANT_Methodref = 10;
public final static int CONSTANT_InterfaceMethodref = 11;
public final static int CONSTANT_NameandType = 12;
public final static int CONSTANT_MethodHandle = 15;
public final static int CONSTANT_MethodType = 16;
public final static int CONSTANT_Dynamic = 17;
public final static int CONSTANT_InvokeDynamic = 18;
public final static int CONSTANT_Module = 19;
public final static int CONSTANT_Package = 20;

public final static int REF_getField = 1;
public final static int REF_getStatic = 2;
public final static int REF_putField = 3;
public final static int REF_putStatic = 4;
public final static int REF_invokeVirtual = 5;
public final static int REF_invokeStatic = 6;
public final static int REF_invokeSpecial = 7;
public final static int REF_newInvokeSpecial = 8;
public final static int REF_invokeInterface = 9;

public final static int MAX_PARAMETERS = 0xff;
public final static int MAX_DIMENSIONS = 0xff;
public final static int MAX_CODE = 0xffff;
public final static int MAX_LOCALS = 0xffff;
public final static int MAX_STACK = 0xffff;

public final static int PREVIEW_MINOR_VERSION = 0xffff;
public static final int CONSTANT_Utf8 = 1;
public static final int CONSTANT_Unicode = 2;
public static final int CONSTANT_Integer = 3;
public static final int CONSTANT_Float = 4;
public static final int CONSTANT_Long = 5;
public static final int CONSTANT_Double = 6;
public static final int CONSTANT_Class = 7;
public static final int CONSTANT_String = 8;
public static final int CONSTANT_Fieldref = 9;
public static final int CONSTANT_Methodref = 10;
public static final int CONSTANT_InterfaceMethodref = 11;
public static final int CONSTANT_NameandType = 12;
public static final int CONSTANT_MethodHandle = 15;
public static final int CONSTANT_MethodType = 16;
public static final int CONSTANT_Dynamic = 17;
public static final int CONSTANT_InvokeDynamic = 18;
public static final int CONSTANT_Module = 19;
public static final int CONSTANT_Package = 20;

public static final int REF_getField = 1;
public static final int REF_getStatic = 2;
public static final int REF_putField = 3;
public static final int REF_putStatic = 4;
public static final int REF_invokeVirtual = 5;
public static final int REF_invokeStatic = 6;
public static final int REF_invokeSpecial = 7;
public static final int REF_newInvokeSpecial = 8;
public static final int REF_invokeInterface = 9;

public static final int MAX_PARAMETERS = 0xff;
public static final int MAX_DIMENSIONS = 0xff;
public static final int MAX_CODE = 0xffff;
public static final int MAX_LOCALS = 0xffff;
public static final int MAX_STACK = 0xffff;

public static final int PREVIEW_MINOR_VERSION = 0xffff;

public enum Version {
V45_3(45, 3), // base level for all attributes
@@ -231,7 +231,7 @@ public static String flagNames(long flags) {
return sbuf.toString();
}
//where
private final static String[] flagName = {
private static final String[] flagName = {
"PUBLIC", "PRIVATE", "PROTECTED", "STATIC", "FINAL",
"SUPER", "VOLATILE", "TRANSIENT", "NATIVE", "INTERFACE",
"ABSTRACT", "STRICTFP"};
@@ -2243,7 +2243,7 @@ public static String mnem(int opcode) {
}

private static class Mneumonics {
private final static String[] mnem = new String[ByteCodeCount];
private static final String[] mnem = new String[ByteCodeCount];
static {
mnem[nop] = "nop";
mnem[aconst_null] = "aconst_null";
@@ -137,7 +137,7 @@ static boolean isFinal(Symbol s) {
static boolean isNative(Symbol s) {
return hasFlag(s, Flags.NATIVE);
}
static private boolean hasFlag(Symbol m, int flag) {
private static boolean hasFlag(Symbol m, int flag) {
return (m.flags() & flag) != 0;
}

@@ -1881,7 +1881,7 @@ JCExpression lambdaExpressionOrStatement(boolean hasParens, boolean explicitPara
}
}

private final static Fragment[][] decisionTable = new Fragment[][] {
private static final Fragment[][] decisionTable = new Fragment[][] {
/* VAR EXPLICIT IMPLICIT */
/* VAR */ {null, VarAndExplicitNotAllowed, VarAndImplicitNotAllowed},
/* EXPLICIT */ {VarAndExplicitNotAllowed, null, ImplicitAndExplicitNotAllowed},
@@ -46,7 +46,7 @@
* An object to contain the result of parsing a reference to an API element.
* Any, but not all, of the member fields may be null.
*/
static public class Reference {
public static class Reference {
public final JCTree.JCExpression moduleName;
/** The type, if any, in the signature. */
public final JCTree qualExpr;
@@ -66,7 +66,7 @@
/**
* An exception that indicates an error occurred while parsing a signature.
*/
static public class ParseException extends Exception {
public static class ParseException extends Exception {
private static final long serialVersionUID = 0;
ParseException(String message) {
super(message);
@@ -390,7 +390,7 @@ public boolean deprecatedFlag() {
}
}

final static class NamedToken extends Token {
static final class NamedToken extends Token {
/** The name of this token */
public final Name name;

@@ -432,7 +432,7 @@ public String stringVal() {
}
}

final static class NumericToken extends StringToken {
static final class NumericToken extends StringToken {
/** The 'radix' value of this token */
public final int radix;

@@ -83,12 +83,12 @@ public Pretty(Writer out, boolean sourceOutput) {
* A string sequence to be used when Pretty output should be constrained
* to fit into a given size
*/
private final static String trimSequence = "[...]";
private static final String trimSequence = "[...]";

/**
* Max number of chars to be generated when output should fit into a single line
*/
private final static int PREFERRED_LENGTH = 20;
private static final int PREFERRED_LENGTH = 20;

/** Align code to be indented to left margin.
*/
@@ -401,7 +401,7 @@ public SimpleConfiguration getConfiguration() {
return config;
}

static public class SimpleConfiguration implements Configuration {
public static class SimpleConfiguration implements Configuration {

protected Map<MultilineLimit, Integer> multilineLimits;
protected EnumSet<DiagnosticPart> visibleParts;
@@ -215,7 +215,7 @@ public BasicConfiguration getConfiguration() {
return (BasicConfiguration)super.getConfiguration();
}

static public class BasicConfiguration extends SimpleConfiguration {
public static class BasicConfiguration extends SimpleConfiguration {

protected Map<DiagnosticPart, Integer> indentationLevels;
protected Map<BasicFormatKind, String> availableFormats;
@@ -84,9 +84,9 @@ static BitsState getState(int[] someBits, boolean reset) {

}

private final static int wordlen = 32;
private final static int wordshift = 5;
private final static int wordmask = wordlen - 1;
private static final int wordlen = 32;
private static final int wordshift = 5;
private static final int wordmask = wordlen - 1;

public int[] bits = null;
// This field will store last version of bits after every change.
@@ -78,12 +78,12 @@ protected Dependencies(Context context) {
/**
* Push a new completion node on the stack.
*/
abstract public void push(ClassSymbol s, CompletionCause phase);
public abstract void push(ClassSymbol s, CompletionCause phase);

/**
* Remove current dependency node from the stack.
*/
abstract public void pop();
public abstract void pop();

public enum CompletionCause implements GraphUtils.DependencyKind {
CLASS_READER,
@@ -40,7 +40,7 @@
protected int[] ints; // the image set
protected int mask; // used to clip int's into the domain
protected int num_bindings; // the number of mappings (including DELETED)
private final static Object DELETED = new Object();
private static final Object DELETED = new Object();

/**
* Construct an Object {@literal ->} int hash table.
@@ -83,7 +83,7 @@ private void update() {
}

@SuppressWarnings("rawtypes")
private final static Iterator EMPTY = new Iterator() {
private static final Iterator EMPTY = new Iterator() {
public boolean hasNext() {
return false;
}
@@ -210,7 +210,7 @@ public static ResourceBundle getDefaultBundle() {
}
}

static private String getLocalizedString(List<ResourceBundle> bundles,
private static String getLocalizedString(List<ResourceBundle> bundles,
String key,
Object... args) {
String msg = null;

1 comment on commit d2df9a7

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on d2df9a7 Apr 1, 2021

Please sign in to comment.