Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8264331: Use the blessed modifier order in jdk.compiler #3235

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -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;
ProTip! Use n and p to navigate between commits in a pull request.