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

8276635: Use blessed modifier order in compiler code #6253

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -89,7 +89,7 @@ enum Kind {
/**
* Used to signal that no position is available.
*/
public final static long NOPOS = -1;
public static final long NOPOS = -1;

/**
* Returns the kind of this diagnostic, for example, error or
@@ -794,7 +794,7 @@ public T getUnderlyingSymbol() {

/** A base class for Symbols representing types.
*/
public static abstract class TypeSymbol extends Symbol {
public abstract static class TypeSymbol extends Symbol {
public TypeSymbol(Kind kind, long flags, Name name, Type type, Symbol owner) {
super(kind, flags, name, type, owner);
}
@@ -241,7 +241,7 @@ public Type(TypeSymbol tsym, TypeMetadata metadata) {
* of a given type expression. This mapping returns the original type is no changes occurred
* when recursively mapping the original type's subterms.
*/
public static abstract class StructuralTypeMapping<S> extends Types.TypeMapping<S> {
public abstract static class StructuralTypeMapping<S> extends Types.TypeMapping<S> {

@Override
public Type visitClassType(ClassType t, S s) {
@@ -1786,7 +1786,7 @@ public String toString() {
}
}

public static abstract class DelegatedType extends Type {
public abstract static class DelegatedType extends Type {
public Type qtype;
public TypeTag tag;

@@ -4896,7 +4896,7 @@ public String toString() {
* type itself) of the operation implemented by this visitor; use
* Void if a second argument is not needed.
*/
public static abstract class DefaultTypeVisitor<R,S> implements Type.Visitor<R,S> {
public abstract static class DefaultTypeVisitor<R,S> implements Type.Visitor<R,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); }
@@ -4923,7 +4923,7 @@ public String toString() {
* symbol itself) of the operation implemented by this visitor; use
* Void if a second argument is not needed.
*/
public static abstract class DefaultSymbolVisitor<R,S> implements Symbol.Visitor<R,S> {
public abstract static class DefaultSymbolVisitor<R,S> implements Symbol.Visitor<R,S> {
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); }
@@ -4946,7 +4946,7 @@ public String toString() {
* type itself) of the operation implemented by this visitor; use
* Void if a second argument is not needed.
*/
public static abstract class SimpleVisitor<R,S> extends DefaultTypeVisitor<R,S> {
public abstract static class SimpleVisitor<R,S> extends DefaultTypeVisitor<R,S> {
@Override
public R visitCapturedType(CapturedType t, S s) {
return visitTypeVar(t, s);
@@ -4966,7 +4966,7 @@ public R visitUndetVar(UndetVar t, S s) {
* form Type&nbsp;&times;&nbsp;Type&nbsp;&rarr;&nbsp;Boolean.
* <!-- In plain text: Type x Type -> Boolean -->
*/
public static abstract class TypeRelation extends SimpleVisitor<Boolean,Type> {}
public abstract static class TypeRelation extends SimpleVisitor<Boolean,Type> {}

/**
* A convenience visitor for implementing operations that only
@@ -4976,7 +4976,7 @@ public static abstract class TypeRelation extends SimpleVisitor<Boolean,Type> {}
* @param <R> the return type of the operation implemented by this
* visitor; use Void if no return type is needed.
*/
public static abstract class UnaryVisitor<R> extends SimpleVisitor<R,Void> {
public abstract static class UnaryVisitor<R> extends SimpleVisitor<R,Void> {
public final R visit(Type t) { return t.accept(this, null); }
}

@@ -5041,7 +5041,7 @@ public RetentionPolicy getRetention(TypeSymbol sym) {

// <editor-fold defaultstate="collapsed" desc="Signature Generation">

public static abstract class SignatureGenerator {
public abstract static class SignatureGenerator {

public static class InvalidSignatureException extends RuntimeException {
private static final long serialVersionUID = 0;
@@ -341,7 +341,7 @@ protected Flow(Context context) {
* Base visitor class for all visitors implementing dataflow analysis logic.
* This class define the shared logic for handling jumps (break/continue statements).
*/
static abstract class BaseAnalyzer extends TreeScanner {
abstract static class BaseAnalyzer extends TreeScanner {

enum JumpKind {
BREAK(JCTree.Tag.BREAK) {
@@ -56,7 +56,7 @@
public class JRTIndex {
/** Get a shared instance of the cache. */
private static JRTIndex sharedInstance;
public synchronized static JRTIndex getSharedInstance() {
public static synchronized JRTIndex getSharedInstance() {
if (sharedInstance == null) {
try {
sharedInstance = new JRTIndex();
@@ -444,7 +444,7 @@ private void addJarClassPath(Path jarFile, boolean warn) {
* @see #initHandlers
* @see #getHandler
*/
protected static abstract class LocationHandler {
protected abstract static class LocationHandler {

/**
* @see JavaFileManager#handleOption
@@ -513,7 +513,7 @@ Iterable<Set<Location>> listLocationsForModules() throws IOException {
/**
* A LocationHandler for a given Location, and associated set of options.
*/
private static abstract class BasicLocationHandler extends LocationHandler {
private abstract static class BasicLocationHandler extends LocationHandler {

final Location location;
final Set<Option> options;
@@ -254,7 +254,7 @@ private void builderToString(JCDiagnostic.DiagnosticPosition pos) {
/**
* Base class for indified concatenation bytecode flavors.
*/
private static abstract class Indy extends StringConcat {
private abstract static class Indy extends StringConcat {
public Indy(Context context) {
super(context);
}
@@ -259,7 +259,7 @@ public void visitError(Attribute.Error e) {
private void typeMismatch(Method method, final Attribute attr) {
class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy {
static final long serialVersionUID = 269;
transient final Method method;
final transient Method method;
AnnotationTypeMismatchExceptionProxy(Method method) {
this.method = method;
}
@@ -1115,7 +1115,7 @@ String newString(int start, int end) {
return new String(buf, start, end - start);
}

private static abstract class TagParser {
private abstract static class TagParser {
enum Kind { INLINE, BLOCK, EITHER }

final Kind kind;
@@ -4988,7 +4988,7 @@ public int replaceTree(JCTree oldTree, JCTree newTree) {

}

protected static abstract class AbstractEndPosTable implements EndPosTable {
protected abstract static class AbstractEndPosTable implements EndPosTable {
/**
* The current parser.
*/
@@ -294,7 +294,7 @@ public int getEndPosition(EndPosTable endPosTable) {
};
}

public static abstract class DCEndPosTree<T extends DCEndPosTree<T>> extends DCTree {
public abstract static class DCEndPosTree<T extends DCEndPosTree<T>> extends DCTree {

private int endPos = NOPOS;

@@ -381,14 +381,14 @@ public int getSourcePosition(int index) {
}
}

public static abstract class DCBlockTag extends DCTree implements BlockTagTree {
public abstract static class DCBlockTag extends DCTree implements BlockTagTree {
@Override @DefinedBy(Api.COMPILER_TREE)
public String getTagName() {
return getKind().tagName;
}
}

public static abstract class DCInlineTag extends DCEndPosTree<DCInlineTag> implements InlineTagTree {
public abstract static class DCInlineTag extends DCEndPosTree<DCInlineTag> implements InlineTagTree {
@Override @DefinedBy(Api.COMPILER_TREE)
public String getTagName() {
return getKind().tagName;
@@ -689,7 +689,7 @@ public Tag getTag() {
}
}

public static abstract class JCStatement extends JCTree implements StatementTree {
public abstract static class JCStatement extends JCTree implements StatementTree {
@Override
public JCStatement setType(Type type) {
super.setType(type);
@@ -702,15 +702,15 @@ public JCStatement setPos(int pos) {
}
}

public static abstract class JCCaseLabel extends JCTree implements CaseLabelTree {
public abstract static class JCCaseLabel extends JCTree implements CaseLabelTree {
public abstract boolean isExpression();
public boolean isNullPattern() {
return isExpression() && TreeInfo.isNull((JCExpression) this);
}
public abstract boolean isPattern();
}

public static abstract class JCExpression extends JCCaseLabel implements ExpressionTree {
public abstract static class JCExpression extends JCCaseLabel implements ExpressionTree {
@Override
public JCExpression setType(Type type) {
super.setType(type);
@@ -740,7 +740,7 @@ public boolean isPattern() {
* Common supertype for all poly expression trees (lambda, method references,
* conditionals, method and constructor calls)
*/
public static abstract class JCPolyExpression extends JCExpression {
public abstract static class JCPolyExpression extends JCExpression {

/**
* A poly expression can only be truly 'poly' in certain contexts
@@ -762,7 +762,7 @@ public enum PolyKind {
/**
* Common supertype for all functional expression trees (lambda and method references)
*/
public static abstract class JCFunctionalExpression extends JCPolyExpression {
public abstract static class JCFunctionalExpression extends JCPolyExpression {

public JCFunctionalExpression() {
//a functional expression is always a 'true' poly
@@ -2056,7 +2056,7 @@ public Tag getTag() {
}
}

public static abstract class JCOperatorExpression extends JCExpression {
public abstract static class JCOperatorExpression extends JCExpression {
public enum OperandPos {
LEFT,
RIGHT
@@ -2238,7 +2238,7 @@ public Tag getTag() {
/**
* Pattern matching forms.
*/
public static abstract class JCPattern extends JCCaseLabel
public abstract static class JCPattern extends JCCaseLabel
implements PatternTree {

@Override
@@ -2989,7 +2989,7 @@ public Tag getTag() {
}
}

public static abstract class JCDirective extends JCTree
public abstract static class JCDirective extends JCTree
implements DirectiveTree {
}

@@ -3401,7 +3401,7 @@ JCNewArray NewArray(JCExpression elemtype,

/** A generic visitor class for trees.
*/
public static abstract class Visitor {
public abstract static class Visitor {
public void visitTopLevel(JCCompilationUnit that) { visitTree(that); }
public void visitPackageDef(JCPackageDecl that) { visitTree(that); }
public void visitImport(JCImport that) { visitTree(that); }
@@ -178,7 +178,7 @@ static EnumSet<DependenciesMode> getDependenciesModes(String[] modes) {
/**
* Class representing a node in the dependency graph.
*/
public static abstract class Node extends GraphUtils.AbstractNode<ClassSymbol, Node>
public abstract static class Node extends GraphUtils.AbstractNode<ClassSymbol, Node>
implements GraphUtils.DottableNode<ClassSymbol, Node> {
/**
* dependant nodes grouped by kind
@@ -54,7 +54,7 @@ public interface DependencyKind { }
/**
* Visitor for graph nodes.
*/
static abstract class NodeVisitor<D, N extends Node<D, N>, A> {
abstract static class NodeVisitor<D, N extends Node<D, N>, A> {
/**
* Visitor action for nodes.
*/
@@ -92,7 +92,7 @@ public void visit(Collection<? extends N> nodes, A arg) {
* This class is a basic abstract class for representing a node.
* A node is associated with a given data.
*/
public static abstract class AbstractNode<D, N extends AbstractNode<D, N>> implements Node<D, N> {
public abstract static class AbstractNode<D, N extends AbstractNode<D, N>> implements Node<D, N> {
public final D data;

public AbstractNode(D data) {
@@ -129,7 +129,7 @@ public <A> void accept(NodeVisitor<D, N, A> visitor, A arg) {
* This class specialized Node, by adding elements that are required in order
* to perform Tarjan computation of strongly connected components.
*/
public static abstract class TarjanNode<D, N extends TarjanNode<D, N>> extends AbstractNode<D, N>
public abstract static class TarjanNode<D, N extends TarjanNode<D, N>> extends AbstractNode<D, N>
implements Comparable<N> {
int index = -1;
int lowlink;
@@ -479,7 +479,7 @@ public int getColumnNumber() {
* created programmatically (by using the supplied factory method) or obtained through build-time
* generated factory methods.
*/
public static abstract class DiagnosticInfo {
public abstract static class DiagnosticInfo {

/** The diagnostic kind (i.e. error). */
DiagnosticType type;
@@ -90,7 +90,7 @@ public String key(String k) {
* Note that javax.tools.DiagnosticListener (if set) is called later in the
* diagnostic pipeline.
*/
public static abstract class DiagnosticHandler {
public abstract static class DiagnosticHandler {
/**
* The previously installed diagnostic handler.
*/
@@ -205,7 +205,7 @@ public <X> X map(NameMapper<X> mapper) {

/** An abstraction for the hash table used to create unique Name instances.
*/
public static abstract class Table {
public abstract static class Table {
/** Standard name table.
*/
public final Names names;
@@ -239,7 +239,7 @@ enum OptionType {
OptionType(String name) { this.name = name; }
}

static abstract class Option {
abstract static class Option {
final boolean hasArg;
final boolean argIsOptional;
final String[] aliases;
@@ -51,7 +51,7 @@
*/
public class DeprecatedListWriter extends SummaryListWriter<DeprecatedAPIListBuilder> {

private final static String TERMINALLY_DEPRECATED_KEY = "doclet.Terminally_Deprecated_Elements";
private static final String TERMINALLY_DEPRECATED_KEY = "doclet.Terminally_Deprecated_Elements";

/**
* Constructor.
@@ -84,8 +84,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
private final BodyContents bodyContents = new BodyContents();

// Maximum number of subpackages and sibling packages to list in related packages table
private final static int MAX_SUBPACKAGES = 20;
private final static int MAX_SIBLING_PACKAGES = 5;
private static final int MAX_SUBPACKAGES = 20;
private static final int MAX_SIBLING_PACKAGES = 5;


/**
@@ -83,7 +83,7 @@ int nameStartPosition() {
* SinglyQuoted or Unquoted to form a (sealed) hierarchy. In that case,
* `Valued` should become abstract similarly to `Attribute`.
*/
final static class Valued extends Attribute {
static final class Valued extends Attribute {

private final String value;

@@ -104,7 +104,7 @@ public int valueStartPosition() {
}
}

final static class Valueless extends Attribute {
static final class Valueless extends Attribute {

Valueless(String name, int nameStartPosition) {
super(name, nameStartPosition);
@@ -48,7 +48,7 @@
*/
public final class MarkupParser {

private final static int EOI = 0x1A;
private static final int EOI = 0x1A;
private char[] buf;
private int bp;
private int buflen;
@@ -378,7 +378,7 @@ private String localize(String code, Object... args) {

// <editor-fold defaultstate="collapsed" desc="DeclScanner">

static abstract class DeclScanner extends TreePathScanner<Void, Void> {
abstract static class DeclScanner extends TreePathScanner<Void, Void> {
final Env env;

public DeclScanner(Env env) {