7033809: Rename "disjunctive" to "union" in javax.lang.model

Wed, 06 Apr 2011 19:30:57 -0700

author
darcy
date
Wed, 06 Apr 2011 19:30:57 -0700
changeset 969
8cc5b440fdde
parent 960
26b065bb4ee7
child 970
f00986f55961

7033809: Rename "disjunctive" to "union" in javax.lang.model
Reviewed-by: mcimadamore, jjg

src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/source/tree/Tree.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/source/tree/TreeVisitor.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/source/tree/UnionTypeTree.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/source/util/SimpleTreeVisitor.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/source/util/TreeScanner.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/code/Flags.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/comp/Attr.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/comp/Flow.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/jvm/Gen.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/parser/JavacParser.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/tree/JCTree.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/tree/Pretty.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/tree/TreeCopier.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/tree/TreeMaker.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/tree/TreeScanner.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/type/DisjunctiveType.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/type/TypeKind.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/type/TypeVisitor.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/type/UnionType.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java file | annotate | diff | comparison | revisions
src/share/classes/javax/lang/model/util/TypeKindVisitor7.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java	Mon Apr 04 19:36:26 2011 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,40 +0,0 @@
     1.4 -/*
     1.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 - *
     1.8 - * This code is free software; you can redistribute it and/or modify it
     1.9 - * under the terms of the GNU General Public License version 2 only, as
    1.10 - * published by the Free Software Foundation.  Oracle designates this
    1.11 - * particular file as subject to the "Classpath" exception as provided
    1.12 - * by Oracle in the LICENSE file that accompanied this code.
    1.13 - *
    1.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 - * version 2 for more details (a copy is included in the LICENSE file that
    1.18 - * accompanied this code).
    1.19 - *
    1.20 - * You should have received a copy of the GNU General Public License version
    1.21 - * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 - *
    1.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 - * or visit www.oracle.com if you need additional information or have any
    1.26 - * questions.
    1.27 - */
    1.28 -
    1.29 -package com.sun.source.tree;
    1.30 -
    1.31 -import java.util.List;
    1.32 -
    1.33 -/**
    1.34 - * A tree node for a disjunctive type expression in a multicatch var declaration.
    1.35 - *
    1.36 - *
    1.37 - * @author Maurizio Cimadamore
    1.38 - *
    1.39 - * @since 1.7
    1.40 - */
    1.41 -public interface DisjunctiveTypeTree extends Tree {
    1.42 -    List<? extends Tree> getTypeAlternatives();
    1.43 -}
     2.1 --- a/src/share/classes/com/sun/source/tree/Tree.java	Mon Apr 04 19:36:26 2011 +0100
     2.2 +++ b/src/share/classes/com/sun/source/tree/Tree.java	Wed Apr 06 19:30:57 2011 -0700
     2.3 @@ -232,9 +232,9 @@
     2.4          PARAMETERIZED_TYPE(ParameterizedTypeTree.class),
     2.5  
     2.6          /**
     2.7 -         * Used for instances of {@link DisjunctiveTypeTree}.
     2.8 +         * Used for instances of {@link UnionTypeTree}.
     2.9           */
    2.10 -        DISJUNCTIVE_TYPE(DisjunctiveTypeTree.class),
    2.11 +        UNION_TYPE(UnionTypeTree.class),
    2.12  
    2.13          /**
    2.14           * Used for instances of {@link TypeCastTree}.
     3.1 --- a/src/share/classes/com/sun/source/tree/TreeVisitor.java	Mon Apr 04 19:36:26 2011 +0100
     3.2 +++ b/src/share/classes/com/sun/source/tree/TreeVisitor.java	Wed Apr 06 19:30:57 2011 -0700
     3.3 @@ -95,7 +95,7 @@
     3.4      R visitCompilationUnit(CompilationUnitTree node, P p);
     3.5      R visitTry(TryTree node, P p);
     3.6      R visitParameterizedType(ParameterizedTypeTree node, P p);
     3.7 -    R visitDisjunctiveType(DisjunctiveTypeTree node, P p);
     3.8 +    R visitUnionType(UnionTypeTree node, P p);
     3.9      R visitArrayType(ArrayTypeTree node, P p);
    3.10      R visitTypeCast(TypeCastTree node, P p);
    3.11      R visitPrimitiveType(PrimitiveTypeTree node, P p);
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/share/classes/com/sun/source/tree/UnionTypeTree.java	Wed Apr 06 19:30:57 2011 -0700
     4.3 @@ -0,0 +1,39 @@
     4.4 +/*
     4.5 + * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
     4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 + *
     4.8 + * This code is free software; you can redistribute it and/or modify it
     4.9 + * under the terms of the GNU General Public License version 2 only, as
    4.10 + * published by the Free Software Foundation.  Oracle designates this
    4.11 + * particular file as subject to the "Classpath" exception as provided
    4.12 + * by Oracle in the LICENSE file that accompanied this code.
    4.13 + *
    4.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    4.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.17 + * version 2 for more details (a copy is included in the LICENSE file that
    4.18 + * accompanied this code).
    4.19 + *
    4.20 + * You should have received a copy of the GNU General Public License version
    4.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    4.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.23 + *
    4.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.25 + * or visit www.oracle.com if you need additional information or have any
    4.26 + * questions.
    4.27 + */
    4.28 +
    4.29 +package com.sun.source.tree;
    4.30 +
    4.31 +import java.util.List;
    4.32 +
    4.33 +/**
    4.34 + * A tree node for a union type expression in a multicatch var declaration.
    4.35 + *
    4.36 + * @author Maurizio Cimadamore
    4.37 + *
    4.38 + * @since 1.7
    4.39 + */
    4.40 +public interface UnionTypeTree extends Tree {
    4.41 +    List<? extends Tree> getTypeAlternatives();
    4.42 +}
     5.1 --- a/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Mon Apr 04 19:36:26 2011 +0100
     5.2 +++ b/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Wed Apr 06 19:30:57 2011 -0700
     5.3 @@ -228,7 +228,7 @@
     5.4          return defaultAction(node, p);
     5.5      }
     5.6  
     5.7 -    public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
     5.8 +    public R visitUnionType(UnionTypeTree node, P p) {
     5.9          return defaultAction(node, p);
    5.10      }
    5.11  
     6.1 --- a/src/share/classes/com/sun/source/util/TreeScanner.java	Mon Apr 04 19:36:26 2011 +0100
     6.2 +++ b/src/share/classes/com/sun/source/util/TreeScanner.java	Wed Apr 06 19:30:57 2011 -0700
     6.3 @@ -355,7 +355,7 @@
     6.4          return r;
     6.5      }
     6.6  
     6.7 -    public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
     6.8 +    public R visitUnionType(UnionTypeTree node, P p) {
     6.9          return scan(node.getTypeAlternatives(), p);
    6.10      }
    6.11  
     7.1 --- a/src/share/classes/com/sun/tools/javac/code/Flags.java	Mon Apr 04 19:36:26 2011 +0100
     7.2 +++ b/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed Apr 06 19:30:57 2011 -0700
     7.3 @@ -231,9 +231,9 @@
     7.4      public static final long PROPRIETARY = 1L<<38;
     7.5  
     7.6      /**
     7.7 -     * Flag that marks a disjunction var in a multi-catch clause
     7.8 +     * Flag that marks a a multi-catch parameter
     7.9       */
    7.10 -    public static final long DISJUNCTION = 1L<<39;
    7.11 +    public static final long UNION = 1L<<39;
    7.12  
    7.13      /**
    7.14       * Flag that marks a signature-polymorphic invoke method.
     8.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Apr 04 19:36:26 2011 +0100
     8.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Apr 06 19:30:57 2011 -0700
     8.3 @@ -1112,7 +1112,7 @@
     8.4              Type ctype = attribStat(c.param, catchEnv);
     8.5              if (TreeInfo.isMultiCatch(c)) {
     8.6                  //multi-catch parameter is implicitly marked as final
     8.7 -                c.param.sym.flags_field |= FINAL | DISJUNCTION;
     8.8 +                c.param.sym.flags_field |= FINAL | UNION;
     8.9              }
    8.10              if (c.param.sym.kind == Kinds.VAR) {
    8.11                  c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER);
    8.12 @@ -2908,7 +2908,7 @@
    8.13          result = check(tree, owntype, TYP, pkind, pt);
    8.14      }
    8.15  
    8.16 -    public void visitTypeDisjunction(JCTypeDisjunction tree) {
    8.17 +    public void visitTypeUnion(JCTypeUnion tree) {
    8.18          ListBuffer<Type> multicatchTypes = ListBuffer.lb();
    8.19          for (JCExpression typeTree : tree.alternatives) {
    8.20              Type ctype = attribType(typeTree, env);
    8.21 @@ -2916,7 +2916,7 @@
    8.22                            chk.checkClassType(typeTree.pos(), ctype),
    8.23                            syms.throwableType);
    8.24              if (!ctype.isErroneous()) {
    8.25 -                //check that alternatives of a disjunctive type are pairwise
    8.26 +                //check that alternatives of a union type are pairwise
    8.27                  //unrelated w.r.t. subtyping
    8.28                  if (chk.intersects(ctype,  multicatchTypes.toList())) {
    8.29                      for (Type t : multicatchTypes) {
     9.1 --- a/src/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Apr 04 19:36:26 2011 +0100
     9.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Apr 06 19:30:57 2011 -0700
     9.3 @@ -381,7 +381,7 @@
     9.4          if (sym.adr >= firstadr && trackable(sym)) {
     9.5              if ((sym.flags() & FINAL) != 0) {
     9.6                  if ((sym.flags() & PARAMETER) != 0) {
     9.7 -                    if ((sym.flags() & DISJUNCTION) != 0) { //multi-catch parameter
     9.8 +                    if ((sym.flags() & UNION) != 0) { //multi-catch parameter
     9.9                          log.error(pos, "multicatch.parameter.may.not.be.assigned",
    9.10                                    sym);
    9.11                      }
    9.12 @@ -1003,7 +1003,7 @@
    9.13          thrown = List.nil();
    9.14          for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
    9.15              List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
    9.16 -                    ((JCTypeDisjunction)l.head.param.vartype).alternatives :
    9.17 +                    ((JCTypeUnion)l.head.param.vartype).alternatives :
    9.18                      List.of(l.head.param.vartype);
    9.19              for (JCExpression ct : subClauses) {
    9.20                  caught = chk.incl(ct.type, caught);
    9.21 @@ -1075,7 +1075,7 @@
    9.22              alive = true;
    9.23              JCVariableDecl param = l.head.param;
    9.24              List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
    9.25 -                    ((JCTypeDisjunction)l.head.param.vartype).alternatives :
    9.26 +                    ((JCTypeUnion)l.head.param.vartype).alternatives :
    9.27                      List.of(l.head.param.vartype);
    9.28              List<Type> ctypes = List.nil();
    9.29              List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);
    10.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Apr 04 19:36:26 2011 +0100
    10.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Apr 06 19:30:57 2011 -0700
    10.3 @@ -1456,7 +1456,7 @@
    10.4                        List<Integer> gaps) {
    10.5              if (startpc != endpc) {
    10.6                  List<JCExpression> subClauses = TreeInfo.isMultiCatch(tree) ?
    10.7 -                        ((JCTypeDisjunction)tree.param.vartype).alternatives :
    10.8 +                        ((JCTypeUnion)tree.param.vartype).alternatives :
    10.9                          List.of(tree.param.vartype);
   10.10                  while (gaps.nonEmpty()) {
   10.11                      for (JCExpression subCatch : subClauses) {
    11.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Mon Apr 04 19:36:26 2011 +0100
    11.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Apr 06 19:30:57 2011 -0700
    11.3 @@ -1837,7 +1837,7 @@
    11.4          JCModifiers mods = optFinal(Flags.PARAMETER);
    11.5          List<JCExpression> catchTypes = catchTypes();
    11.6          JCExpression paramType = catchTypes.size() > 1 ?
    11.7 -                toP(F.at(catchTypes.head.getStartPosition()).TypeDisjunction(catchTypes)) :
    11.8 +                toP(F.at(catchTypes.head.getStartPosition()).TypeUnion(catchTypes)) :
    11.9                  catchTypes.head;
   11.10          JCVariableDecl formal = variableDeclaratorId(mods, paramType);
   11.11          accept(RPAREN);
    12.1 --- a/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Mon Apr 04 19:36:26 2011 +0100
    12.2 +++ b/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Wed Apr 06 19:30:57 2011 -0700
    12.3 @@ -236,13 +236,13 @@
    12.4       */
    12.5      public static final int TYPEAPPLY = TYPEARRAY + 1;
    12.6  
    12.7 -    /** Disjunction types, of type TypeDisjunction
    12.8 +    /** Union types, of type TypeUnion
    12.9       */
   12.10 -    public static final int TYPEDISJUNCTION = TYPEAPPLY + 1;
   12.11 +    public static final int TYPEUNION = TYPEAPPLY + 1;
   12.12  
   12.13      /** Formal type parameters, of type TypeParameter.
   12.14       */
   12.15 -    public static final int TYPEPARAMETER = TYPEDISJUNCTION + 1;
   12.16 +    public static final int TYPEPARAMETER = TYPEUNION + 1;
   12.17  
   12.18      /** Type argument.
   12.19       */
   12.20 @@ -1881,30 +1881,30 @@
   12.21      }
   12.22  
   12.23      /**
   12.24 -     * A disjunction type, T1 | T2 | ... Tn (used in multicatch statements)
   12.25 +     * A union type, T1 | T2 | ... Tn (used in multicatch statements)
   12.26       */
   12.27 -    public static class JCTypeDisjunction extends JCExpression implements DisjunctiveTypeTree {
   12.28 +    public static class JCTypeUnion extends JCExpression implements UnionTypeTree {
   12.29  
   12.30          public List<JCExpression> alternatives;
   12.31  
   12.32 -        protected JCTypeDisjunction(List<JCExpression> components) {
   12.33 +        protected JCTypeUnion(List<JCExpression> components) {
   12.34              this.alternatives = components;
   12.35          }
   12.36          @Override
   12.37 -        public void accept(Visitor v) { v.visitTypeDisjunction(this); }
   12.38 +        public void accept(Visitor v) { v.visitTypeUnion(this); }
   12.39  
   12.40 -        public Kind getKind() { return Kind.DISJUNCTIVE_TYPE; }
   12.41 +        public Kind getKind() { return Kind.UNION_TYPE; }
   12.42  
   12.43          public List<JCExpression> getTypeAlternatives() {
   12.44              return alternatives;
   12.45          }
   12.46          @Override
   12.47          public <R,D> R accept(TreeVisitor<R,D> v, D d) {
   12.48 -            return v.visitDisjunctiveType(this, d);
   12.49 +            return v.visitUnionType(this, d);
   12.50          }
   12.51          @Override
   12.52          public int getTag() {
   12.53 -            return TYPEDISJUNCTION;
   12.54 +            return TYPEUNION;
   12.55          }
   12.56      }
   12.57  
   12.58 @@ -2227,7 +2227,7 @@
   12.59          public void visitTypeIdent(JCPrimitiveTypeTree that) { visitTree(that); }
   12.60          public void visitTypeArray(JCArrayTypeTree that)     { visitTree(that); }
   12.61          public void visitTypeApply(JCTypeApply that)         { visitTree(that); }
   12.62 -        public void visitTypeDisjunction(JCTypeDisjunction that)   { visitTree(that); }
   12.63 +        public void visitTypeUnion(JCTypeUnion that)         { visitTree(that); }
   12.64          public void visitTypeParameter(JCTypeParameter that) { visitTree(that); }
   12.65          public void visitWildcard(JCWildcard that)           { visitTree(that); }
   12.66          public void visitTypeBoundKind(TypeBoundKind that)   { visitTree(that); }
    13.1 --- a/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Mon Apr 04 19:36:26 2011 +0100
    13.2 +++ b/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Wed Apr 06 19:30:57 2011 -0700
    13.3 @@ -1169,7 +1169,7 @@
    13.4          }
    13.5      }
    13.6  
    13.7 -    public void visitTypeDisjunction(JCTypeDisjunction tree) {
    13.8 +    public void visitTypeUnion(JCTypeUnion tree) {
    13.9          try {
   13.10              printExprs(tree.alternatives, " | ");
   13.11          } catch (IOException e) {
    14.1 --- a/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Mon Apr 04 19:36:26 2011 +0100
    14.2 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Wed Apr 06 19:30:57 2011 -0700
    14.3 @@ -338,10 +338,10 @@
    14.4          return M.at(t.pos).TypeApply(clazz, arguments);
    14.5      }
    14.6  
    14.7 -    public JCTree visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
    14.8 -        JCTypeDisjunction t = (JCTypeDisjunction) node;
    14.9 +    public JCTree visitUnionType(UnionTypeTree node, P p) {
   14.10 +        JCTypeUnion t = (JCTypeUnion) node;
   14.11          List<JCExpression> components = copy(t.alternatives, p);
   14.12 -        return M.at(t.pos).TypeDisjunction(components);
   14.13 +        return M.at(t.pos).TypeUnion(components);
   14.14      }
   14.15  
   14.16      public JCTree visitArrayType(ArrayTypeTree node, P p) {
    15.1 --- a/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Mon Apr 04 19:36:26 2011 +0100
    15.2 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Apr 06 19:30:57 2011 -0700
    15.3 @@ -119,7 +119,7 @@
    15.4      }
    15.5  
    15.6      public static boolean isMultiCatch(JCCatch catchClause) {
    15.7 -        return catchClause.param.vartype.getTag() == JCTree.TYPEDISJUNCTION;
    15.8 +        return catchClause.param.vartype.getTag() == JCTree.TYPEUNION;
    15.9      }
   15.10  
   15.11      /** Is statement an initializer for a synthetic field?
    16.1 --- a/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Mon Apr 04 19:36:26 2011 +0100
    16.2 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Wed Apr 06 19:30:57 2011 -0700
    16.3 @@ -435,8 +435,8 @@
    16.4          return tree;
    16.5      }
    16.6  
    16.7 -    public JCTypeDisjunction TypeDisjunction(List<JCExpression> components) {
    16.8 -        JCTypeDisjunction tree = new JCTypeDisjunction(components);
    16.9 +    public JCTypeUnion TypeUnion(List<JCExpression> components) {
   16.10 +        JCTypeUnion tree = new JCTypeUnion(components);
   16.11          tree.pos = pos;
   16.12          return tree;
   16.13      }
    17.1 --- a/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Mon Apr 04 19:36:26 2011 +0100
    17.2 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Wed Apr 06 19:30:57 2011 -0700
    17.3 @@ -272,7 +272,7 @@
    17.4          scan(tree.arguments);
    17.5      }
    17.6  
    17.7 -    public void visitTypeDisjunction(JCTypeDisjunction tree) {
    17.8 +    public void visitTypeUnion(JCTypeUnion tree) {
    17.9          scan(tree.alternatives);
   17.10      }
   17.11  
    18.1 --- a/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Mon Apr 04 19:36:26 2011 +0100
    18.2 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Wed Apr 06 19:30:57 2011 -0700
    18.3 @@ -363,7 +363,7 @@
    18.4          result = tree;
    18.5      }
    18.6  
    18.7 -    public void visitTypeDisjunction(JCTypeDisjunction tree) {
    18.8 +    public void visitTypeUnion(JCTypeUnion tree) {
    18.9          tree.alternatives = translate(tree.alternatives);
   18.10          result = tree;
   18.11      }
    19.1 --- a/src/share/classes/javax/lang/model/type/DisjunctiveType.java	Mon Apr 04 19:36:26 2011 +0100
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,49 +0,0 @@
    19.4 -/*
    19.5 - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
    19.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.7 - *
    19.8 - * This code is free software; you can redistribute it and/or modify it
    19.9 - * under the terms of the GNU General Public License version 2 only, as
   19.10 - * published by the Free Software Foundation.  Oracle designates this
   19.11 - * particular file as subject to the "Classpath" exception as provided
   19.12 - * by Oracle in the LICENSE file that accompanied this code.
   19.13 - *
   19.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   19.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   19.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   19.17 - * version 2 for more details (a copy is included in the LICENSE file that
   19.18 - * accompanied this code).
   19.19 - *
   19.20 - * You should have received a copy of the GNU General Public License version
   19.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   19.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   19.23 - *
   19.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   19.25 - * or visit www.oracle.com if you need additional information or have any
   19.26 - * questions.
   19.27 - */
   19.28 -
   19.29 -package javax.lang.model.type;
   19.30 -
   19.31 -import java.util.List;
   19.32 -
   19.33 -/**
   19.34 - * Represents a disjunctive type.
   19.35 - *
   19.36 - * As of the {@link javax.lang.model.SourceVersion#RELEASE_7
   19.37 - * RELEASE_7} source version, disjunctive types can appear as the type
   19.38 - * of a multi-catch exception parameter.
   19.39 - *
   19.40 - * @since 1.7
   19.41 - */
   19.42 -public interface DisjunctiveType extends TypeMirror {
   19.43 -
   19.44 -    /**
   19.45 -     * Return the alternatives comprising this disjunctive type.
   19.46 -     *
   19.47 -     * The alternatives are formally referred to as <i>disjuncts</i>.
   19.48 -     *
   19.49 -     * @return the alternatives comprising this disjunctive type.
   19.50 -     */
   19.51 -    List<? extends TypeMirror> getAlternatives();
   19.52 -}
    20.1 --- a/src/share/classes/javax/lang/model/type/TypeKind.java	Mon Apr 04 19:36:26 2011 +0100
    20.2 +++ b/src/share/classes/javax/lang/model/type/TypeKind.java	Wed Apr 06 19:30:57 2011 -0700
    20.3 @@ -140,11 +140,11 @@
    20.4      OTHER,
    20.5  
    20.6      /**
    20.7 -      * A disjunctive type.
    20.8 +      * A union type.
    20.9        *
   20.10        * @since 1.7
   20.11        */
   20.12 -    DISJUNCTIVE;
   20.13 +    UNION;
   20.14  
   20.15      /**
   20.16       * Returns {@code true} if this kind corresponds to a primitive
    21.1 --- a/src/share/classes/javax/lang/model/type/TypeVisitor.java	Mon Apr 04 19:36:26 2011 +0100
    21.2 +++ b/src/share/classes/javax/lang/model/type/TypeVisitor.java	Wed Apr 06 19:30:57 2011 -0700
    21.3 @@ -164,12 +164,12 @@
    21.4      R visitUnknown(TypeMirror t, P p);
    21.5  
    21.6      /**
    21.7 -     * Visits a disjunctive type.
    21.8 +     * Visits a union type.
    21.9       *
   21.10       * @param t the type to visit
   21.11       * @param p a visitor-specified parameter
   21.12       * @return  a visitor-specified result
   21.13       * @since 1.7
   21.14       */
   21.15 -    R visitDisjunctive(DisjunctiveType t, P p);
   21.16 +    R visitUnion(UnionType t, P p);
   21.17  }
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/src/share/classes/javax/lang/model/type/UnionType.java	Wed Apr 06 19:30:57 2011 -0700
    22.3 @@ -0,0 +1,47 @@
    22.4 +/*
    22.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
    22.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    22.7 + *
    22.8 + * This code is free software; you can redistribute it and/or modify it
    22.9 + * under the terms of the GNU General Public License version 2 only, as
   22.10 + * published by the Free Software Foundation.  Oracle designates this
   22.11 + * particular file as subject to the "Classpath" exception as provided
   22.12 + * by Oracle in the LICENSE file that accompanied this code.
   22.13 + *
   22.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   22.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   22.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   22.17 + * version 2 for more details (a copy is included in the LICENSE file that
   22.18 + * accompanied this code).
   22.19 + *
   22.20 + * You should have received a copy of the GNU General Public License version
   22.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   22.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   22.23 + *
   22.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   22.25 + * or visit www.oracle.com if you need additional information or have any
   22.26 + * questions.
   22.27 + */
   22.28 +
   22.29 +package javax.lang.model.type;
   22.30 +
   22.31 +import java.util.List;
   22.32 +
   22.33 +/**
   22.34 + * Represents a union type.
   22.35 + *
   22.36 + * As of the {@link javax.lang.model.SourceVersion#RELEASE_7
   22.37 + * RELEASE_7} source version, union types can appear as the type
   22.38 + * of a multi-catch exception parameter.
   22.39 + *
   22.40 + * @since 1.7
   22.41 + */
   22.42 +public interface UnionType extends TypeMirror {
   22.43 +
   22.44 +    /**
   22.45 +     * Return the alternatives comprising this union type.
   22.46 +     *
   22.47 +     * @return the alternatives comprising this union type.
   22.48 +     */
   22.49 +    List<? extends TypeMirror> getAlternatives();
   22.50 +}
    23.1 --- a/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java	Mon Apr 04 19:36:26 2011 +0100
    23.2 +++ b/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java	Wed Apr 06 19:30:57 2011 -0700
    23.3 @@ -96,7 +96,7 @@
    23.4      }
    23.5  
    23.6      /**
    23.7 -     * Visits a {@code DisjunctiveType} element by calling {@code
    23.8 +     * Visits a {@code UnionType} element by calling {@code
    23.9       * visitUnknown}.
   23.10  
   23.11       * @param t  {@inheritDoc}
   23.12 @@ -105,7 +105,7 @@
   23.13       *
   23.14       * @since 1.7
   23.15       */
   23.16 -    public R visitDisjunctive(DisjunctiveType t, P p) {
   23.17 +    public R visitUnion(UnionType t, P p) {
   23.18          return visitUnknown(t, p);
   23.19      }
   23.20  
    24.1 --- a/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java	Mon Apr 04 19:36:26 2011 +0100
    24.2 +++ b/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java	Wed Apr 06 19:30:57 2011 -0700
    24.3 @@ -67,11 +67,11 @@
    24.4      }
    24.5  
    24.6      /**
    24.7 -     * Visits a {@code DisjunctiveType} in a manner defined by a subclass.
    24.8 +     * Visits a {@code UnionType} in a manner defined by a subclass.
    24.9       *
   24.10       * @param t  {@inheritDoc}
   24.11       * @param p  {@inheritDoc}
   24.12       * @return the result of the visit as defined by a subclass
   24.13       */
   24.14 -    public abstract R visitDisjunctive(DisjunctiveType t, P p);
   24.15 +    public abstract R visitUnion(UnionType t, P p);
   24.16  }
    25.1 --- a/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java	Mon Apr 04 19:36:26 2011 +0100
    25.2 +++ b/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java	Wed Apr 06 19:30:57 2011 -0700
    25.3 @@ -91,7 +91,7 @@
    25.4      }
    25.5  
    25.6      /**
    25.7 -     * This implementation visits a {@code DisjunctiveType} by calling
    25.8 +     * This implementation visits a {@code UnionType} by calling
    25.9       * {@code defaultAction}.
   25.10       *
   25.11       * @param t  {@inheritDoc}
   25.12 @@ -99,7 +99,7 @@
   25.13       * @return the result of {@code defaultAction}
   25.14       */
   25.15      @Override
   25.16 -    public R visitDisjunctive(DisjunctiveType t, P p) {
   25.17 +    public R visitUnion(UnionType t, P p) {
   25.18          return defaultAction(t, p);
   25.19      }
   25.20  }
    26.1 --- a/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java	Mon Apr 04 19:36:26 2011 +0100
    26.2 +++ b/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java	Wed Apr 06 19:30:57 2011 -0700
    26.3 @@ -94,7 +94,7 @@
    26.4      }
    26.5  
    26.6      /**
    26.7 -     * This implementation visits a {@code DisjunctiveType} by calling
    26.8 +     * This implementation visits a {@code UnionType} by calling
    26.9       * {@code defaultAction}.
   26.10       *
   26.11       * @param t  {@inheritDoc}
   26.12 @@ -102,7 +102,7 @@
   26.13       * @return the result of {@code defaultAction}
   26.14       */
   26.15      @Override
   26.16 -    public R visitDisjunctive(DisjunctiveType t, P p) {
   26.17 +    public R visitUnion(UnionType t, P p) {
   26.18          return defaultAction(t, p);
   26.19      }
   26.20  }

mercurial