6949587: rename "DisjointType" to "DisjunctType"

Reviewed-by: mcimadamore
This commit is contained in:
Jonathan Gibbons 2010-10-26 14:29:48 -07:00
parent 35cc8afcf9
commit efaaa59c32
17 changed files with 48 additions and 48 deletions

View file

@ -28,13 +28,13 @@ package com.sun.source.tree;
import java.util.List; import java.util.List;
/** /**
* A tree node for a disjoint type expression in a multicatch var declaration. * A tree node for a disjunctive type expression in a multicatch var declaration.
* *
* *
* @author Maurizio Cimadamore * @author Maurizio Cimadamore
* *
* @since 1.7 * @since 1.7
*/ */
public interface DisjointTypeTree extends Tree { public interface DisjunctiveTypeTree extends Tree {
List<? extends Tree> getTypeComponents(); List<? extends Tree> getTypeAlternatives();
} }

View file

@ -234,9 +234,9 @@ public interface Tree {
PARAMETERIZED_TYPE(ParameterizedTypeTree.class), PARAMETERIZED_TYPE(ParameterizedTypeTree.class),
/** /**
* Used for instances of {@link DisjointTypeTree}. * Used for instances of {@link DisjunctiveTypeTree}.
*/ */
DISJOINT_TYPE(DisjointTypeTree.class), DISJUNCTIVE_TYPE(DisjunctiveTypeTree.class),
/** /**
* Used for instances of {@link TypeCastTree}. * Used for instances of {@link TypeCastTree}.

View file

@ -96,7 +96,7 @@ public interface TreeVisitor<R,P> {
R visitCompilationUnit(CompilationUnitTree node, P p); R visitCompilationUnit(CompilationUnitTree node, P p);
R visitTry(TryTree node, P p); R visitTry(TryTree node, P p);
R visitParameterizedType(ParameterizedTypeTree node, P p); R visitParameterizedType(ParameterizedTypeTree node, P p);
R visitDisjointType(DisjointTypeTree node, P p); R visitDisjunctiveType(DisjunctiveTypeTree node, P p);
R visitArrayType(ArrayTypeTree node, P p); R visitArrayType(ArrayTypeTree node, P p);
R visitTypeCast(TypeCastTree node, P p); R visitTypeCast(TypeCastTree node, P p);
R visitPrimitiveType(PrimitiveTypeTree node, P p); R visitPrimitiveType(PrimitiveTypeTree node, P p);

View file

@ -228,7 +228,7 @@ public class SimpleTreeVisitor <R,P> implements TreeVisitor<R,P> {
return defaultAction(node, p); return defaultAction(node, p);
} }
public R visitDisjointType(DisjointTypeTree node, P p) { public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
return defaultAction(node, p); return defaultAction(node, p);
} }

View file

@ -356,8 +356,8 @@ public class TreeScanner<R,P> implements TreeVisitor<R,P> {
return r; return r;
} }
public R visitDisjointType(DisjointTypeTree node, P p) { public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
return scan(node.getTypeComponents(), p); return scan(node.getTypeAlternatives(), p);
} }
public R visitTypeParameter(TypeParameterTree node, P p) { public R visitTypeParameter(TypeParameterTree node, P p) {

View file

@ -231,9 +231,9 @@ public class Flags {
public static final long PROPRIETARY = 1L<<38; public static final long PROPRIETARY = 1L<<38;
/** /**
* Flag that marks a disjoint var in a multi-catch clause * Flag that marks a disjunction var in a multi-catch clause
*/ */
public static final long DISJOINT = 1L<<39; public static final long DISJUNCTION = 1L<<39;
/** /**
* Flag that marks a signature-polymorphic invoke method. * Flag that marks a signature-polymorphic invoke method.

View file

@ -1053,7 +1053,7 @@ public class Attr extends JCTree.Visitor {
if ((c.param.sym.flags() & FINAL) == 0) { if ((c.param.sym.flags() & FINAL) == 0) {
log.error(c.param.pos(), "multicatch.param.must.be.final", c.param.sym); log.error(c.param.pos(), "multicatch.param.must.be.final", c.param.sym);
} }
c.param.sym.flags_field = c.param.sym.flags() | DISJOINT; c.param.sym.flags_field = c.param.sym.flags() | DISJUNCTION;
} }
if (c.param.sym.kind == Kinds.VAR) { if (c.param.sym.kind == Kinds.VAR) {
c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER); c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER);
@ -2839,9 +2839,9 @@ public class Attr extends JCTree.Visitor {
result = check(tree, owntype, TYP, pkind, pt); result = check(tree, owntype, TYP, pkind, pt);
} }
public void visitTypeDisjoint(JCTypeDisjoint tree) { public void visitTypeDisjunction(JCTypeDisjunction tree) {
List<Type> componentTypes = attribTypes(tree.components, env); List<Type> alternatives = attribTypes(tree.alternatives, env);
tree.type = result = check(tree, types.lub(componentTypes), TYP, pkind, pt); tree.type = result = check(tree, types.lub(alternatives), TYP, pkind, pt);
} }
public void visitTypeParameter(JCTypeParameter tree) { public void visitTypeParameter(JCTypeParameter tree) {

View file

@ -371,7 +371,7 @@ public class Flow extends TreeScanner {
if (sym.adr >= firstadr && trackable(sym)) { if (sym.adr >= firstadr && trackable(sym)) {
if ((sym.flags() & FINAL) != 0) { if ((sym.flags() & FINAL) != 0) {
if ((sym.flags() & PARAMETER) != 0) { if ((sym.flags() & PARAMETER) != 0) {
if ((sym.flags() & DISJOINT) != 0) { //multi-catch parameter if ((sym.flags() & DISJUNCTION) != 0) { //multi-catch parameter
log.error(pos, "multicatch.parameter.may.not.be.assigned", log.error(pos, "multicatch.parameter.may.not.be.assigned",
sym); sym);
} }
@ -983,7 +983,7 @@ public class Flow extends TreeScanner {
thrown = List.nil(); thrown = List.nil();
for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) { for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ? List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
((JCTypeDisjoint)l.head.param.vartype).components : ((JCTypeDisjunction)l.head.param.vartype).alternatives :
List.of(l.head.param.vartype); List.of(l.head.param.vartype);
for (JCExpression ct : subClauses) { for (JCExpression ct : subClauses) {
caught = chk.incl(ct.type, caught); caught = chk.incl(ct.type, caught);
@ -1049,7 +1049,7 @@ public class Flow extends TreeScanner {
alive = true; alive = true;
JCVariableDecl param = l.head.param; JCVariableDecl param = l.head.param;
List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ? List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ?
((JCTypeDisjoint)l.head.param.vartype).components : ((JCTypeDisjunction)l.head.param.vartype).alternatives :
List.of(l.head.param.vartype); List.of(l.head.param.vartype);
List<Type> ctypes = List.nil(); List<Type> ctypes = List.nil();
List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry); List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry);

View file

@ -1456,7 +1456,7 @@ public class Gen extends JCTree.Visitor {
List<Integer> gaps) { List<Integer> gaps) {
if (startpc != endpc) { if (startpc != endpc) {
List<JCExpression> subClauses = TreeInfo.isMultiCatch(tree) ? List<JCExpression> subClauses = TreeInfo.isMultiCatch(tree) ?
((JCTypeDisjoint)tree.param.vartype).components : ((JCTypeDisjunction)tree.param.vartype).alternatives :
List.of(tree.param.vartype); List.of(tree.param.vartype);
while (gaps.nonEmpty()) { while (gaps.nonEmpty()) {
for (JCExpression subCatch : subClauses) { for (JCExpression subCatch : subClauses) {

View file

@ -1827,7 +1827,7 @@ public class JavacParser implements Parser {
JCModifiers mods = optFinal(Flags.PARAMETER); JCModifiers mods = optFinal(Flags.PARAMETER);
List<JCExpression> catchTypes = catchTypes(); List<JCExpression> catchTypes = catchTypes();
JCExpression paramType = catchTypes.size() > 1 ? JCExpression paramType = catchTypes.size() > 1 ?
toP(F.at(catchTypes.head.getStartPosition()).TypeDisjoint(catchTypes)) : toP(F.at(catchTypes.head.getStartPosition()).TypeDisjunction(catchTypes)) :
catchTypes.head; catchTypes.head;
JCVariableDecl formal = variableDeclaratorId(mods, paramType); JCVariableDecl formal = variableDeclaratorId(mods, paramType);
accept(RPAREN); accept(RPAREN);

View file

@ -236,13 +236,13 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
*/ */
public static final int TYPEAPPLY = TYPEARRAY + 1; public static final int TYPEAPPLY = TYPEARRAY + 1;
/** Disjunctive types, of type TypeDisjoint. /** Disjunction types, of type TypeDisjunction
*/ */
public static final int TYPEDISJOINT = TYPEAPPLY + 1; public static final int TYPEDISJUNCTION = TYPEAPPLY + 1;
/** Formal type parameters, of type TypeParameter. /** Formal type parameters, of type TypeParameter.
*/ */
public static final int TYPEPARAMETER = TYPEDISJOINT + 1; public static final int TYPEPARAMETER = TYPEDISJUNCTION + 1;
/** Type argument. /** Type argument.
*/ */
@ -1888,30 +1888,30 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
} }
/** /**
* A disjoint type, T1 | T2 | ... Tn (used in multicatch statements) * A disjunction type, T1 | T2 | ... Tn (used in multicatch statements)
*/ */
public static class JCTypeDisjoint extends JCExpression implements DisjointTypeTree { public static class JCTypeDisjunction extends JCExpression implements DisjunctiveTypeTree {
public List<JCExpression> components; public List<JCExpression> alternatives;
protected JCTypeDisjoint(List<JCExpression> components) { protected JCTypeDisjunction(List<JCExpression> components) {
this.components = components; this.alternatives = components;
} }
@Override @Override
public void accept(Visitor v) { v.visitTypeDisjoint(this); } public void accept(Visitor v) { v.visitTypeDisjunction(this); }
public Kind getKind() { return Kind.DISJOINT_TYPE; } public Kind getKind() { return Kind.DISJUNCTIVE_TYPE; }
public List<JCExpression> getTypeComponents() { public List<JCExpression> getTypeAlternatives() {
return components; return alternatives;
} }
@Override @Override
public <R,D> R accept(TreeVisitor<R,D> v, D d) { public <R,D> R accept(TreeVisitor<R,D> v, D d) {
return v.visitDisjointType(this, d); return v.visitDisjunctiveType(this, d);
} }
@Override @Override
public int getTag() { public int getTag() {
return TYPEDISJOINT; return TYPEDISJUNCTION;
} }
} }
@ -2284,7 +2284,7 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
public void visitTypeIdent(JCPrimitiveTypeTree that) { visitTree(that); } public void visitTypeIdent(JCPrimitiveTypeTree that) { visitTree(that); }
public void visitTypeArray(JCArrayTypeTree that) { visitTree(that); } public void visitTypeArray(JCArrayTypeTree that) { visitTree(that); }
public void visitTypeApply(JCTypeApply that) { visitTree(that); } public void visitTypeApply(JCTypeApply that) { visitTree(that); }
public void visitTypeDisjoint(JCTypeDisjoint that) { visitTree(that); } public void visitTypeDisjunction(JCTypeDisjunction that) { visitTree(that); }
public void visitTypeParameter(JCTypeParameter that) { visitTree(that); } public void visitTypeParameter(JCTypeParameter that) { visitTree(that); }
public void visitWildcard(JCWildcard that) { visitTree(that); } public void visitWildcard(JCWildcard that) { visitTree(that); }
public void visitTypeBoundKind(TypeBoundKind that) { visitTree(that); } public void visitTypeBoundKind(TypeBoundKind that) { visitTree(that); }

View file

@ -1195,9 +1195,9 @@ public class Pretty extends JCTree.Visitor {
} }
} }
public void visitTypeDisjoint(JCTypeDisjoint tree) { public void visitTypeDisjunction(JCTypeDisjunction tree) {
try { try {
printExprs(tree.components, " | "); printExprs(tree.alternatives, " | ");
} catch (IOException e) { } catch (IOException e) {
throw new UncheckedIOException(e); throw new UncheckedIOException(e);
} }

View file

@ -346,10 +346,10 @@ public class TreeCopier<P> implements TreeVisitor<JCTree,P> {
return M.at(t.pos).TypeApply(clazz, arguments); return M.at(t.pos).TypeApply(clazz, arguments);
} }
public JCTree visitDisjointType(DisjointTypeTree node, P p) { public JCTree visitDisjunctiveType(DisjunctiveTypeTree node, P p) {
JCTypeDisjoint t = (JCTypeDisjoint) node; JCTypeDisjunction t = (JCTypeDisjunction) node;
List<JCExpression> components = copy(t.components, p); List<JCExpression> components = copy(t.alternatives, p);
return M.at(t.pos).TypeDisjoint(components); return M.at(t.pos).TypeDisjunction(components);
} }
public JCTree visitArrayType(ArrayTypeTree node, P p) { public JCTree visitArrayType(ArrayTypeTree node, P p) {

View file

@ -119,7 +119,7 @@ public class TreeInfo {
} }
public static boolean isMultiCatch(JCCatch catchClause) { public static boolean isMultiCatch(JCCatch catchClause) {
return catchClause.param.vartype.getTag() == JCTree.TYPEDISJOINT; return catchClause.param.vartype.getTag() == JCTree.TYPEDISJUNCTION;
} }
/** Is statement an initializer for a synthetic field? /** Is statement an initializer for a synthetic field?

View file

@ -451,8 +451,8 @@ public class TreeMaker implements JCTree.Factory {
return tree; return tree;
} }
public JCTypeDisjoint TypeDisjoint(List<JCExpression> components) { public JCTypeDisjunction TypeDisjunction(List<JCExpression> components) {
JCTypeDisjoint tree = new JCTypeDisjoint(components); JCTypeDisjunction tree = new JCTypeDisjunction(components);
tree.pos = pos; tree.pos = pos;
return tree; return tree;
} }

View file

@ -276,8 +276,8 @@ public class TreeScanner extends Visitor {
scan(tree.arguments); scan(tree.arguments);
} }
public void visitTypeDisjoint(JCTypeDisjoint tree) { public void visitTypeDisjunction(JCTypeDisjunction tree) {
scan(tree.components); scan(tree.alternatives);
} }
public void visitTypeParameter(JCTypeParameter tree) { public void visitTypeParameter(JCTypeParameter tree) {

View file

@ -368,8 +368,8 @@ public class TreeTranslator extends JCTree.Visitor {
result = tree; result = tree;
} }
public void visitTypeDisjoint(JCTypeDisjoint tree) { public void visitTypeDisjunction(JCTypeDisjunction tree) {
tree.components = translate(tree.components); tree.alternatives = translate(tree.alternatives);
result = tree; result = tree;
} }