changeset 48128:f39471b530ca datum

removing remaining references to datum
author vromero
date Wed, 29 Nov 2017 15:06:36 -0500
parents f2e367b90111
children 08f552df175c
files src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java
diffstat 11 files changed, 55 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java	Wed Nov 29 15:06:36 2017 -0500
@@ -314,13 +314,13 @@
     public static final long ANONCONSTR_BASED = 1L<<57;
 
     /**
-     * Flag to indicate that a class is a datum. The flag is also used to mark fields that are
-     * part of the state vector of a datum class.
+     * Flag to indicate that a class is a record. The flag is also used to mark fields that are
+     * part of the state vector of a record.
      */
     public static final long RECORD = 1L<<58;
 
     /**
-     * Flag to indicate that a datum field is non-final.
+     * Flag to indicate that a record field is non-final.
      */
     public static final long NON_FINAL = 1L<<59;
 
@@ -439,7 +439,7 @@
         DEPRECATED_ANNOTATION(Flags.DEPRECATED_ANNOTATION),
         DEPRECATED_REMOVAL(Flags.DEPRECATED_REMOVAL),
         HAS_RESOURCE(Flags.HAS_RESOURCE),
-        DATUM(Flags.RECORD),
+        RECORD(Flags.RECORD),
         NON_FINAL(Flags.NON_FINAL);
 
         Flag(long flag) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Wed Nov 29 15:06:36 2017 -0500
@@ -1482,7 +1482,7 @@
 
     // </editor-fold>
 
-    public List<VarSymbol> datumVars(Type t) {
+    public List<VarSymbol> recordVars(Type t) {
         List<VarSymbol> vars = List.nil();
         while (!t.hasTag(NONE)) {
             if (t.hasTag(CLASS)) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Nov 29 15:06:36 2017 -0500
@@ -4625,7 +4625,7 @@
                         }
                     }
 
-                    List<VarSymbol> supRecordFields = types.datumVars(sup);
+                    List<VarSymbol> supRecordFields = types.recordVars(sup);
                     for (JCTree supField : superFields) {
                         JCVariableDecl supVarDecl = (JCVariableDecl)supField;
                         if (supRecordFields.isEmpty()) break; //arity mismatches will be checked inside implicit constructor
@@ -4641,10 +4641,10 @@
                         supRecordFields = supRecordFields.tail;
                     }
 
-                    List<VarSymbol> vars = types.datumVars(c.type).stream()
+                    List<VarSymbol> vars = types.recordVars(c.type).stream()
                             .filter(v -> v.owner == c)
                             .collect(List.collector());
-                    env.info.datumImplicitConstructor = new MethodSymbol(0, names.init,
+                    env.info.recordImplicitConstructor = new MethodSymbol(0, names.init,
                             new MethodType(vars.map(v -> v.type), syms.voidType, List.nil(), syms.methodClass),
                             c);
                 }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java	Wed Nov 29 15:06:36 2017 -0500
@@ -113,7 +113,7 @@
      */
     JCTree preferredTreeForDiagnostics;
 
-    MethodSymbol datumImplicitConstructor;
+    MethodSymbol recordImplicitConstructor;
 
     /** Duplicate this context, replacing scope field and copying all others.
      */
@@ -135,7 +135,7 @@
         info.isNewClass = isNewClass;
         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
         info.visitingServiceImplementation = visitingServiceImplementation;
-        info.datumImplicitConstructor = datumImplicitConstructor;
+        info.recordImplicitConstructor = recordImplicitConstructor;
         return info;
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Nov 29 15:06:36 2017 -0500
@@ -1886,9 +1886,9 @@
                     if (isInitialConstructor) {
                         boolean isSynthesized = (tree.sym.flags() &
                                                  GENERATEDCONSTR) != 0;
-                        boolean isDatum = (tree.sym.owner.flags() & Flags.RECORD) != 0;
-                        // skip datum as they are generated by the compiler and guaranteed to be correct
-                        if (!isDatum || !isSynthesized) {
+                        boolean isRecord = (tree.sym.owner.flags() & Flags.RECORD) != 0;
+                        // skip record as they are generated by the compiler and guaranteed to be correct
+                        if (!isRecord || !isSynthesized) {
                             for (int i = firstadr; i < nextadr; i++) {
                                 JCVariableDecl vardecl = vardecls[i];
                                 VarSymbol var = vardecl.sym;
@@ -2335,7 +2335,7 @@
             scanExpr(tree.meth);
             scanExprs(tree.args);
             if (TreeInfo.name(tree.meth) == names._default) {
-                types.datumVars(classDef.type).stream()
+                types.recordVars(classDef.type).stream()
                         .filter(v -> v.owner == classDef.sym)
                         .forEach(v -> letInit(tree.pos(), v));
             }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Nov 29 15:06:36 2017 -0500
@@ -2240,7 +2240,7 @@
             visitEnumDef(tree);
 
         if ((tree.mods.flags & (RECORD | ABSTRACT)) == RECORD) {
-            visitDatumDef(tree);
+            visitRecordDef(tree);
         }
 
         // If this is a nested class, define a this$n field for
@@ -2498,7 +2498,7 @@
             prepend(makeLit(syms.stringType, var.name.toString()));
     }
 
-    /** Translate a datum class. */
+    /** Translate a record. */
 
     enum GenerationSwitch {
         OLD_EQUALS,
@@ -2508,9 +2508,9 @@
 
     private EnumSet<GenerationSwitch> generationSwitchSet = EnumSet.noneOf(GenerationSwitch.class);
 
-    private void visitDatumDef(JCClassDecl tree) {
+    private void visitRecordDef(JCClassDecl tree) {
         make_at(tree.pos());
-        List<VarSymbol> vars = types.datumVars(tree.type);
+        List<VarSymbol> vars = types.recordVars(tree.type);
         Pool.MethodHandle[] getterMethHandles = new Pool.MethodHandle[vars.size()];
         int index = 0;
         for (VarSymbol var : vars) {
@@ -2524,18 +2524,18 @@
         tree.defs = tree.defs.appendList(accessors(tree));
         tree.defs = tree.defs.appendList(List.of(
                 generationSwitchSet.contains(GenerationSwitch.OLD_EQUALS) ?
-                        datumOldEquals(tree, vars):
-                        datumEquals(tree, getterMethHandles),
+                        recordOldEquals(tree, vars):
+                        recordEquals(tree, getterMethHandles),
                 generationSwitchSet.contains(GenerationSwitch.OLD_TOSTRING) ?
-                        datumOldToString(tree, vars):
-                        datumToString(tree, vars, getterMethHandles),
+                        recordOldToString(tree, vars):
+                        recordToString(tree, vars, getterMethHandles),
                 generationSwitchSet.contains(GenerationSwitch.OLD_HASCODE) ?
-                        datumOldHashCode(tree, vars):
-                        datumHashCode(tree, getterMethHandles)
+                        recordOldHashCode(tree, vars):
+                        recordHashCode(tree, getterMethHandles)
         ));
     }
 
-    JCTree datumToString(JCClassDecl tree, List<VarSymbol> vars, Pool.MethodHandle[] getterMethHandles) {
+    JCTree recordToString(JCClassDecl tree, List<VarSymbol> vars, Pool.MethodHandle[] getterMethHandles) {
         make_at(tree.pos());
 
         MethodSymbol msym = lookupMethod(tree.pos(),
@@ -2573,7 +2573,7 @@
         }
     }
 
-    JCTree datumHashCode(JCClassDecl tree, Pool.MethodHandle[] getterMethHandles) {
+    JCTree recordHashCode(JCClassDecl tree, Pool.MethodHandle[] getterMethHandles) {
         make_at(tree.pos());
         MethodSymbol msym = lookupMethod(tree.pos(),
                          names.hashCode,
@@ -2605,7 +2605,7 @@
         }
     }
 
-    JCTree datumEquals(JCClassDecl tree, Pool.MethodHandle[] getterMethHandles) {
+    JCTree recordEquals(JCClassDecl tree, Pool.MethodHandle[] getterMethHandles) {
         make_at(tree.pos());
         MethodSymbol msym = lookupMethod(tree.pos(),
                          names.equals,
@@ -2672,7 +2672,7 @@
         return qualifier;
     }
 
-    JCTree datumOldToString(JCClassDecl tree, List<VarSymbol> vars) {
+    JCTree recordOldToString(JCClassDecl tree, List<VarSymbol> vars) {
         make_at(tree.pos());
 
         MethodSymbol toStringSym = lookupMethod(tree.pos(),
@@ -2700,7 +2700,7 @@
         }
     }
 
-    JCTree datumOldHashCode(JCClassDecl tree, List<VarSymbol> vars) {
+    JCTree recordOldHashCode(JCClassDecl tree, List<VarSymbol> vars) {
         make_at(tree.pos());
 
         MethodSymbol hashCodeSym = lookupMethod(tree.pos(),
@@ -2723,7 +2723,7 @@
         }
     }
 
-    JCTree datumOldEquals(JCClassDecl tree, List<VarSymbol> vars) {
+    JCTree recordOldEquals(JCClassDecl tree, List<VarSymbol> vars) {
         make_at(tree.pos());
 
         MethodSymbol oldEqualsSym = lookupMethod(tree.pos(),
@@ -3761,7 +3761,7 @@
         if (tree.expr.hasTag(APPLY) &&
                 TreeInfo.name(((JCMethodInvocation)tree.expr).meth) == names._default) {
             //inline constructor assignments
-            List<VarSymbol> vars = types.datumVars(currentClass.type).stream()
+            List<VarSymbol> vars = types.recordVars(currentClass.type).stream()
                             .filter(v -> v.owner == currentClass)
                             .collect(List.collector());
             ListBuffer<JCStatement> stats = new ListBuffer<>();
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Nov 29 15:06:36 2017 -0500
@@ -1914,7 +1914,7 @@
         if (name == names._default &&
                 env.enclMethod != null &&
                 env.enclMethod.sym.name == names.init) {
-            return env.info.datumImplicitConstructor;
+            return env.info.recordImplicitConstructor;
         }
 
         Env<AttrContext> env1 = env;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Wed Nov 29 15:06:36 2017 -0500
@@ -803,7 +803,7 @@
     private final class HeaderPhase extends AbstractHeaderPhase {
 
         public HeaderPhase() {
-            super(CompletionCause.HEADER_PHASE, new DatumPhase());
+            super(CompletionCause.HEADER_PHASE, new RecordPhase());
         }
 
         @Override
@@ -882,10 +882,10 @@
         }
     }
 
-    private final class DatumPhase extends AbstractMembersPhase {
+    private final class RecordPhase extends AbstractMembersPhase {
 
-        public DatumPhase() {
-            super(CompletionCause.DATUM_PHASE, new MembersPhase());
+        public RecordPhase() {
+            super(CompletionCause.RECORD_PHASE, new MembersPhase());
         }
 
         @Override
@@ -893,7 +893,7 @@
             JCClassDecl tree = env.enclClass;
             ClassSymbol sym = tree.sym;
             if ((sym.flags_field & RECORD) != 0) {
-                memberEnter.memberEnter(TreeInfo.datumFields(tree), env);
+                memberEnter.memberEnter(TreeInfo.recordFields(tree), env);
                 memberEnter.memberEnter(TreeInfo.superRecordFields(tree), env);
             }
         }
@@ -927,7 +927,7 @@
                         }
                     }
                 } else if ((sym.flags() & RECORD) != 0) {
-                    helper = new DatumConstructorHelper(sym, TreeInfo.datumFields(tree).map(vd -> vd.sym), TreeInfo.superRecordFields(tree));
+                    helper = new RecordConstructorHelper(sym, TreeInfo.recordFields(tree).map(vd -> vd.sym), TreeInfo.superRecordFields(tree));
                 }
                 if (helper != null) {
                     JCTree constrDef = DefaultConstructor(make.at(tree.pos), helper);
@@ -967,10 +967,10 @@
                 addEnumMembers(tree, env);
             }
             List<JCTree> defsToEnter = (tree.sym.flags_field & RECORD) != 0 ?
-                    tree.defs.diff(List.convert(JCTree.class, TreeInfo.datumFields(tree))) : tree.defs;
+                    tree.defs.diff(List.convert(JCTree.class, TreeInfo.recordFields(tree))) : tree.defs;
             memberEnter.memberEnter(defsToEnter, env);
             if ((tree.mods.flags & (RECORD | ABSTRACT)) == RECORD) {
-                addDatumMembersIfNeeded(tree, env);
+                addRecordMembersIfNeeded(tree, env);
             }
 
             if (tree.sym.isAnnotationType()) {
@@ -1044,10 +1044,10 @@
             memberEnter.memberEnter(valueOf, env);
         }
 
-        /** Add the implicit members for a datum type
+        /** Add the implicit members for a record
          *  to the symbol table.
          */
-        private void addDatumMembersIfNeeded(JCClassDecl tree, Env<AttrContext> env) {
+        private void addRecordMembersIfNeeded(JCClassDecl tree, Env<AttrContext> env) {
 
             if (lookupMethod(tree.sym, names.toString, List.nil()) == null) {
                 JCExpression toStringType = make.Type(new ArrayType(tree.sym.type, syms.arrayClass));
@@ -1239,14 +1239,14 @@
         }
     }
 
-    class DatumConstructorHelper extends BasicConstructorHelper {
+    class RecordConstructorHelper extends BasicConstructorHelper {
 
-        List<VarSymbol> datumFields;
+        List<VarSymbol> recordFields;
         List<JCVariableDecl> superFields;
 
-        DatumConstructorHelper(TypeSymbol owner, List<VarSymbol> datumFields, List<JCVariableDecl> superFields) {
+        RecordConstructorHelper(TypeSymbol owner, List<VarSymbol> recordFields, List<JCVariableDecl> superFields) {
             super(owner);
-            this.datumFields = datumFields;
+            this.recordFields = recordFields;
             this.superFields = superFields;
         }
 
@@ -1254,7 +1254,7 @@
         public Type constructorType() {
             if (constructorType == null) {
                 List<Type> argtypes = superFields.map(v -> v.vartype.type)
-                        .appendList(datumFields.map(v -> v.type));
+                        .appendList(recordFields.map(v -> v.type));
                 constructorType = new MethodType(argtypes, syms.voidType, List.nil(), syms.methodClass);
             }
             return constructorType;
@@ -1267,7 +1267,7 @@
             for (JCVariableDecl p : superFields) {
                 params.add(new VarSymbol(MANDATED | PARAMETER, p.name, p.vartype.type, csym));
             }
-            for (VarSymbol p : datumFields) {
+            for (VarSymbol p : recordFields) {
                 params.add(new VarSymbol(MANDATED | PARAMETER, p.name, p.type, csym));
             }
             csym.params = params.toList();
@@ -1282,7 +1282,7 @@
 
         @Override
         public List<Name> inits() {
-            return datumFields.map(v -> v.name);
+            return recordFields.map(v -> v.name);
         }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Nov 29 15:06:36 2017 -0500
@@ -3564,13 +3564,13 @@
         return name;
     }
 
-    Map<Name, JCTree> headerFields(JCModifiers datumClassMods) {
+    Map<Name, JCTree> headerFields(JCModifiers recordClassMods) {
         accept(LPAREN);
         Map<Name, JCTree> fields = new LinkedHashMap<>();
         while (token.kind != RPAREN) {
             JCModifiers mods = modifiersOpt();
             mods.flags |= Flags.RECORD;
-            mods.flags |= (datumClassMods.flags & Flags.ABSTRACT) != 0 ? Flags.PROTECTED : 0;
+            mods.flags |= (recordClassMods.flags & Flags.ABSTRACT) != 0 ? Flags.PROTECTED : 0;
             if ((mods.flags & Flags.NON_FINAL) == 0) {
                 mods.flags |= Flags.FINAL;
             }
@@ -3740,7 +3740,7 @@
             if (!isRecord) {
                 defs.appendList(classOrInterfaceBodyDeclaration(className, isInterface));
             } else {
-                defs.appendList(datumBodyDeclaration(className));
+                defs.appendList(recordBodyDeclaration(className));
             }
             if (token.pos <= endPosTable.errorEndPos) {
                // error recovery
@@ -3874,7 +3874,7 @@
         }
     }
 
-    protected List<JCTree> datumBodyDeclaration(Name className) {
+    protected List<JCTree> recordBodyDeclaration(Name className) {
         Comment dc = token.comment(CommentStyle.JAVADOC);
         JCModifiers mods = modifiersOpt();
         return methodOrFieldMemberDecl(className, mods, false, dc, true);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Nov 29 15:06:36 2017 -0500
@@ -160,7 +160,7 @@
         }
     }
 
-    public static List<JCVariableDecl> datumFields(JCClassDecl tree) {
+    public static List<JCVariableDecl> recordFields(JCClassDecl tree) {
         return tree.defs.stream()
                 .filter(t -> t.hasTag(VARDEF))
                 .map(t -> (JCVariableDecl)t)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java	Wed Nov 29 14:29:08 2017 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java	Wed Nov 29 15:06:36 2017 -0500
@@ -91,7 +91,7 @@
         HIERARCHY_PHASE,
         IMPORTS_PHASE,
         MEMBER_ENTER,
-        DATUM_PHASE,
+        RECORD_PHASE,
         MEMBERS_PHASE,
         OTHER;
     }