7137836: tidy up Names.java
authorjjg
Fri, 24 Feb 2012 10:40:32 -0800
changeset 12014 9515b1eb2a87
parent 12013 fdcc73079b81
child 12015 0c9d42e88feb
7137836: tidy up Names.java Reviewed-by: mcimadamore
langtools/src/share/classes/com/sun/tools/javac/util/Names.java
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Thu Feb 23 09:53:09 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Fri Feb 24 10:40:32 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -47,108 +47,127 @@
         return instance;
     }
 
-    public final Name slash;
+    // operators and punctuation
+    public final Name asterisk;
+    public final Name comma;
+    public final Name empty;
     public final Name hyphen;
-    public final Name T;
-    public final Name slashequals;
-    public final Name deprecated;
-    public final Name init;
-    public final Name clinit;
-    public final Name error;
-    public final Name any;
-    public final Name empty;
     public final Name one;
     public final Name period;
-    public final Name comma;
     public final Name semicolon;
-    public final Name asterisk;
-    public final Name _this;
+    public final Name slash;
+    public final Name slashequals;
+
+    // keywords
+    public final Name _class;
+    public final Name _default;
     public final Name _super;
-    public final Name _default;
-    public final Name _class;
-    public final Name java_lang;
-    public final Name java_lang_Object;
+    public final Name _this;
+
+    // field and method names
+    public final Name _name;
+    public final Name addSuppressed;
+    public final Name any;
+    public final Name append;
+    public final Name clinit;
+    public final Name clone;
+    public final Name close;
+    public final Name compareTo;
+    public final Name desiredAssertionStatus;
+    public final Name equals;
+    public final Name error;
+    public final Name family;
+    public final Name finalize;
+    public final Name forName;
+    public final Name getClass;
+    public final Name getClassLoader;
+    public final Name getComponentType;
+    public final Name getDeclaringClass;
+    public final Name getMessage;
+    public final Name hasNext;
+    public final Name hashCode;
+    public final Name init;
+    public final Name initCause;
+    public final Name iterator;
+    public final Name length;
+    public final Name next;
+    public final Name ordinal;
+    public final Name serialVersionUID;
+    public final Name toString;
+    public final Name value;
+    public final Name valueOf;
+    public final Name values;
+
+    // class names
+    public final Name java_io_Serializable;
+    public final Name java_lang_AutoCloseable;
     public final Name java_lang_Class;
     public final Name java_lang_Cloneable;
-    public final Name java_io_Serializable;
-    public final Name serialVersionUID;
     public final Name java_lang_Enum;
+    public final Name java_lang_Object;
     public final Name java_lang_invoke_MethodHandle;
-    public final Name package_info;
+
+    // names of builtin classes
+    public final Name Array;
+    public final Name Bound;
+    public final Name Method;
+
+    // package names
+    public final Name java_lang;
+
+    // attribute names
+    public final Name Annotation;
+    public final Name AnnotationDefault;
+    public final Name Bridge;
+    public final Name CharacterRangeTable;
+    public final Name Code;
+    public final Name CompilationID;
     public final Name ConstantValue;
+    public final Name Deprecated;
+    public final Name EnclosingMethod;
+    public final Name Enum;
+    public final Name Exceptions;
+    public final Name InnerClasses;
     public final Name LineNumberTable;
     public final Name LocalVariableTable;
     public final Name LocalVariableTypeTable;
-    public final Name CharacterRangeTable;
+    public final Name RuntimeInvisibleAnnotations;
+    public final Name RuntimeInvisibleParameterAnnotations;
+    public final Name RuntimeInvisibleTypeAnnotations;
+    public final Name RuntimeVisibleAnnotations;
+    public final Name RuntimeVisibleParameterAnnotations;
+    public final Name RuntimeVisibleTypeAnnotations;
+    public final Name Signature;
+    public final Name SourceFile;
+    public final Name SourceID;
     public final Name StackMap;
     public final Name StackMapTable;
-    public final Name SourceID;
-    public final Name CompilationID;
-    public final Name Code;
-    public final Name Exceptions;
-    public final Name SourceFile;
-    public final Name InnerClasses;
     public final Name Synthetic;
-    public final Name Bridge;
-    public final Name Deprecated;
-    public final Name Enum;
-    public final Name _name;
-    public final Name Signature;
-    public final Name Varargs;
-    public final Name Annotation;
-    public final Name RuntimeVisibleAnnotations;
-    public final Name RuntimeInvisibleAnnotations;
-    public final Name RuntimeVisibleTypeAnnotations;
-    public final Name RuntimeInvisibleTypeAnnotations;
-    public final Name RuntimeVisibleParameterAnnotations;
-    public final Name RuntimeInvisibleParameterAnnotations;
     public final Name Value;
-    public final Name EnclosingMethod;
-    public final Name desiredAssertionStatus;
-    public final Name append;
-    public final Name family;
-    public final Name forName;
-    public final Name toString;
-    public final Name length;
-    public final Name valueOf;
-    public final Name value;
-    public final Name getMessage;
-    public final Name getClass;
+    public final Name Varargs;
+
+    // members of java.lang.annotation.ElementType
+    public final Name ANNOTATION_TYPE;
+    public final Name CONSTRUCTOR;
+    public final Name FIELD;
+    public final Name LOCAL_VARIABLE;
+    public final Name METHOD;
+    public final Name PACKAGE;
+    public final Name PARAMETER;
     public final Name TYPE;
+    public final Name TYPE_PARAMETER;
     public final Name TYPE_USE;
-    public final Name TYPE_PARAMETER;
-    public final Name FIELD;
-    public final Name METHOD;
-    public final Name PARAMETER;
-    public final Name CONSTRUCTOR;
-    public final Name LOCAL_VARIABLE;
-    public final Name ANNOTATION_TYPE;
-    public final Name PACKAGE;
-    public final Name SOURCE;
+
+    // members of java.lang.annotation.RetentionPolicy
     public final Name CLASS;
     public final Name RUNTIME;
-    public final Name Array;
-    public final Name Method;
-    public final Name Bound;
-    public final Name clone;
-    public final Name getComponentType;
-    public final Name getClassLoader;
-    public final Name initCause;
-    public final Name values;
-    public final Name iterator;
-    public final Name hasNext;
-    public final Name next;
-    public final Name AnnotationDefault;
-    public final Name ordinal;
-    public final Name equals;
-    public final Name hashCode;
-    public final Name compareTo;
-    public final Name getDeclaringClass;
+    public final Name SOURCE;
+
+    // other identifiers
+    public final Name T;
+    public final Name deprecated;
     public final Name ex;
-    public final Name finalize;
-    public final Name java_lang_AutoCloseable;
-    public final Name close;
-    public final Name addSuppressed;
+    public final Name package_info;
 
     public final Name.Table table;
 
@@ -156,116 +175,127 @@
         Options options = Options.instance(context);
         table = createTable(options);
 
-        slash = fromString("/");
+        // operators and punctuation
+        asterisk = fromString("*");
+        comma = fromString(",");
+        empty = fromString("");
         hyphen = fromString("-");
-        T = fromString("T");
-        slashequals = fromString("/=");
-        deprecated = fromString("deprecated");
-
-        init = fromString("<init>");
-        clinit = fromString("<clinit>");
-        error = fromString("<error>");
-        any = fromString("<any>");
-        empty = fromString("");
         one = fromString("1");
         period = fromString(".");
-        comma = fromString(",");
         semicolon = fromString(";");
-        asterisk = fromString("*");
-        _this = fromString("this");
+        slash = fromString("/");
+        slashequals = fromString("/=");
+
+        // keywords
+        _class = fromString("class");
+        _default = fromString("default");
         _super = fromString("super");
-        _default = fromString("default");
+        _this = fromString("this");
 
-        _class = fromString("class");
-        java_lang = fromString("java.lang");
-        java_lang_Object = fromString("java.lang.Object");
+        // field and method names
+        _name = fromString("name");
+        addSuppressed = fromString("addSuppressed");
+        any = fromString("<any>");
+        append = fromString("append");
+        clinit = fromString("<clinit>");
+        clone = fromString("clone");
+        close = fromString("close");
+        compareTo = fromString("compareTo");
+        desiredAssertionStatus = fromString("desiredAssertionStatus");
+        equals = fromString("equals");
+        error = fromString("<error>");
+        family = fromString("family");
+        finalize = fromString("finalize");
+        forName = fromString("forName");
+        getClass = fromString("getClass");
+        getClassLoader = fromString("getClassLoader");
+        getComponentType = fromString("getComponentType");
+        getDeclaringClass = fromString("getDeclaringClass");
+        getMessage = fromString("getMessage");
+        hasNext = fromString("hasNext");
+        hashCode = fromString("hashCode");
+        init = fromString("<init>");
+        initCause = fromString("initCause");
+        iterator = fromString("iterator");
+        length = fromString("length");
+        next = fromString("next");
+        ordinal = fromString("ordinal");
+        serialVersionUID = fromString("serialVersionUID");
+        toString = fromString("toString");
+        value = fromString("value");
+        valueOf = fromString("valueOf");
+        values = fromString("values");
+
+        // class names
+        java_io_Serializable = fromString("java.io.Serializable");
+        java_lang_AutoCloseable = fromString("java.lang.AutoCloseable");
         java_lang_Class = fromString("java.lang.Class");
         java_lang_Cloneable = fromString("java.lang.Cloneable");
-        java_io_Serializable = fromString("java.io.Serializable");
         java_lang_Enum = fromString("java.lang.Enum");
+        java_lang_Object = fromString("java.lang.Object");
         java_lang_invoke_MethodHandle = fromString("java.lang.invoke.MethodHandle");
-        package_info = fromString("package-info");
-        serialVersionUID = fromString("serialVersionUID");
+
+        // names of builtin classes
+        Array = fromString("Array");
+        Bound = fromString("Bound");
+        Method = fromString("Method");
+
+        // package names
+        java_lang = fromString("java.lang");
+
+        // attribute names
+        Annotation = fromString("Annotation");
+        AnnotationDefault = fromString("AnnotationDefault");
+        Bridge = fromString("Bridge");
+        CharacterRangeTable = fromString("CharacterRangeTable");
+        Code = fromString("Code");
+        CompilationID = fromString("CompilationID");
         ConstantValue = fromString("ConstantValue");
+        Deprecated = fromString("Deprecated");
+        EnclosingMethod = fromString("EnclosingMethod");
+        Enum = fromString("Enum");
+        Exceptions = fromString("Exceptions");
+        InnerClasses = fromString("InnerClasses");
         LineNumberTable = fromString("LineNumberTable");
         LocalVariableTable = fromString("LocalVariableTable");
         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
-        CharacterRangeTable = fromString("CharacterRangeTable");
+        RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
+        RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
+        RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
+        RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
+        RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
+        RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
+        Signature = fromString("Signature");
+        SourceFile = fromString("SourceFile");
+        SourceID = fromString("SourceID");
         StackMap = fromString("StackMap");
         StackMapTable = fromString("StackMapTable");
-        SourceID = fromString("SourceID");
-        CompilationID = fromString("CompilationID");
-        Code = fromString("Code");
-        Exceptions = fromString("Exceptions");
-        SourceFile = fromString("SourceFile");
-        InnerClasses = fromString("InnerClasses");
         Synthetic = fromString("Synthetic");
-        Bridge = fromString("Bridge");
-        Deprecated = fromString("Deprecated");
-        Enum = fromString("Enum");
-        _name = fromString("name");
-        Signature = fromString("Signature");
+        Value = fromString("Value");
         Varargs = fromString("Varargs");
-        Annotation = fromString("Annotation");
-        RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
-        RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
-        RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
-        RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
-        RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
-        RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
-        Value = fromString("Value");
-        EnclosingMethod = fromString("EnclosingMethod");
 
-        desiredAssertionStatus = fromString("desiredAssertionStatus");
-
-        append = fromString("append");
-        family = fromString("family");
-        forName = fromString("forName");
-        toString = fromString("toString");
-        length = fromString("length");
-        valueOf = fromString("valueOf");
-        value = fromString("value");
-        getMessage = fromString("getMessage");
-        getClass = fromString("getClass");
+        // members of java.lang.annotation.ElementType
+        ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
+        CONSTRUCTOR = fromString("CONSTRUCTOR");
+        FIELD = fromString("FIELD");
+        LOCAL_VARIABLE = fromString("LOCAL_VARIABLE");
+        METHOD = fromString("METHOD");
+        PACKAGE = fromString("PACKAGE");
+        PARAMETER = fromString("PARAMETER");
+        TYPE = fromString("TYPE");
+        TYPE_PARAMETER = fromString("TYPE_PARAMETER");
+        TYPE_USE = fromString("TYPE_USE");
 
-        TYPE = fromString("TYPE");
-        TYPE_USE = fromString("TYPE_USE");
-        TYPE_PARAMETER = fromString("TYPE_PARAMETER");
-        FIELD = fromString("FIELD");
-        METHOD = fromString("METHOD");
-        PARAMETER = fromString("PARAMETER");
-        CONSTRUCTOR = fromString("CONSTRUCTOR");
-        LOCAL_VARIABLE = fromString("LOCAL_VARIABLE");
-        ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
-        PACKAGE = fromString("PACKAGE");
-
-        SOURCE = fromString("SOURCE");
+        // members of java.lang.annotation.RetentionPolicy
         CLASS = fromString("CLASS");
         RUNTIME = fromString("RUNTIME");
+        SOURCE = fromString("SOURCE");
 
-        Array = fromString("Array");
-        Method = fromString("Method");
-        Bound = fromString("Bound");
-        clone = fromString("clone");
-        getComponentType = fromString("getComponentType");
-        getClassLoader = fromString("getClassLoader");
-        initCause = fromString("initCause");
-        values = fromString("values");
-        iterator = fromString("iterator");
-        hasNext = fromString("hasNext");
-        next = fromString("next");
-        AnnotationDefault = fromString("AnnotationDefault");
-        ordinal = fromString("ordinal");
-        equals = fromString("equals");
-        hashCode = fromString("hashCode");
-        compareTo = fromString("compareTo");
-        getDeclaringClass = fromString("getDeclaringClass");
+        // other identifiers
+        T = fromString("T");
+        deprecated = fromString("deprecated");
         ex = fromString("ex");
-        finalize = fromString("finalize");
-
-        java_lang_AutoCloseable = fromString("java.lang.AutoCloseable");
-        close = fromString("close");
-        addSuppressed = fromString("addSuppressed");
+        package_info = fromString("package-info");
     }
 
     protected Name.Table createTable(Options options) {