Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
5ec39895
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5ec39895
编写于
4月 06, 2011
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7033809: Rename "disjunctive" to "union" in javax.lang.model
Reviewed-by: mcimadamore, jjg
上级
b995fb4f
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
55 addition
and
58 deletion
+55
-58
src/share/classes/com/sun/source/tree/Tree.java
src/share/classes/com/sun/source/tree/Tree.java
+2
-2
src/share/classes/com/sun/source/tree/TreeVisitor.java
src/share/classes/com/sun/source/tree/TreeVisitor.java
+1
-1
src/share/classes/com/sun/source/tree/UnionTypeTree.java
src/share/classes/com/sun/source/tree/UnionTypeTree.java
+3
-4
src/share/classes/com/sun/source/util/SimpleTreeVisitor.java
src/share/classes/com/sun/source/util/SimpleTreeVisitor.java
+1
-1
src/share/classes/com/sun/source/util/TreeScanner.java
src/share/classes/com/sun/source/util/TreeScanner.java
+1
-1
src/share/classes/com/sun/tools/javac/code/Flags.java
src/share/classes/com/sun/tools/javac/code/Flags.java
+2
-2
src/share/classes/com/sun/tools/javac/comp/Attr.java
src/share/classes/com/sun/tools/javac/comp/Attr.java
+3
-3
src/share/classes/com/sun/tools/javac/comp/Flow.java
src/share/classes/com/sun/tools/javac/comp/Flow.java
+3
-3
src/share/classes/com/sun/tools/javac/jvm/Gen.java
src/share/classes/com/sun/tools/javac/jvm/Gen.java
+1
-1
src/share/classes/com/sun/tools/javac/parser/JavacParser.java
...share/classes/com/sun/tools/javac/parser/JavacParser.java
+1
-1
src/share/classes/com/sun/tools/javac/tree/JCTree.java
src/share/classes/com/sun/tools/javac/tree/JCTree.java
+11
-11
src/share/classes/com/sun/tools/javac/tree/Pretty.java
src/share/classes/com/sun/tools/javac/tree/Pretty.java
+1
-1
src/share/classes/com/sun/tools/javac/tree/TreeCopier.java
src/share/classes/com/sun/tools/javac/tree/TreeCopier.java
+3
-3
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+1
-1
src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
+2
-2
src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
+1
-1
src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java
...hare/classes/com/sun/tools/javac/tree/TreeTranslator.java
+1
-1
src/share/classes/javax/lang/model/type/TypeKind.java
src/share/classes/javax/lang/model/type/TypeKind.java
+2
-2
src/share/classes/javax/lang/model/type/TypeVisitor.java
src/share/classes/javax/lang/model/type/TypeVisitor.java
+2
-2
src/share/classes/javax/lang/model/type/UnionType.java
src/share/classes/javax/lang/model/type/UnionType.java
+5
-7
src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
...e/classes/javax/lang/model/util/AbstractTypeVisitor6.java
+2
-2
src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java
...e/classes/javax/lang/model/util/AbstractTypeVisitor7.java
+2
-2
src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java
...are/classes/javax/lang/model/util/SimpleTypeVisitor7.java
+2
-2
src/share/classes/javax/lang/model/util/TypeKindVisitor7.java
...share/classes/javax/lang/model/util/TypeKindVisitor7.java
+2
-2
未找到文件。
src/share/classes/com/sun/source/tree/Tree.java
浏览文件 @
5ec39895
...
@@ -232,9 +232,9 @@ public interface Tree {
...
@@ -232,9 +232,9 @@ public interface Tree {
PARAMETERIZED_TYPE
(
ParameterizedTypeTree
.
class
),
PARAMETERIZED_TYPE
(
ParameterizedTypeTree
.
class
),
/**
/**
* Used for instances of {@link
Disjunctive
TypeTree}.
* Used for instances of {@link
Union
TypeTree}.
*/
*/
DISJUNCTIVE_TYPE
(
Disjunctive
TypeTree
.
class
),
UNION_TYPE
(
Union
TypeTree
.
class
),
/**
/**
* Used for instances of {@link TypeCastTree}.
* Used for instances of {@link TypeCastTree}.
...
...
src/share/classes/com/sun/source/tree/TreeVisitor.java
浏览文件 @
5ec39895
...
@@ -95,7 +95,7 @@ public interface TreeVisitor<R,P> {
...
@@ -95,7 +95,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
visit
DisjunctiveType
(
Disjunctive
TypeTree
node
,
P
p
);
R
visit
UnionType
(
Union
TypeTree
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
);
...
...
src/share/classes/com/sun/source/tree/
Disjunctive
TypeTree.java
→
src/share/classes/com/sun/source/tree/
Union
TypeTree.java
浏览文件 @
5ec39895
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2011
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -28,13 +28,12 @@ package com.sun.source.tree;
...
@@ -28,13 +28,12 @@ package com.sun.source.tree;
import
java.util.List
;
import
java.util.List
;
/**
/**
* A tree node for a disjunctive type expression in a multicatch var declaration.
* A tree node for a union type expression in a multicatch var declaration.
*
*
*
* @author Maurizio Cimadamore
* @author Maurizio Cimadamore
*
*
* @since 1.7
* @since 1.7
*/
*/
public
interface
Disjunctive
TypeTree
extends
Tree
{
public
interface
Union
TypeTree
extends
Tree
{
List
<?
extends
Tree
>
getTypeAlternatives
();
List
<?
extends
Tree
>
getTypeAlternatives
();
}
}
src/share/classes/com/sun/source/util/SimpleTreeVisitor.java
浏览文件 @
5ec39895
...
@@ -228,7 +228,7 @@ public class SimpleTreeVisitor <R,P> implements TreeVisitor<R,P> {
...
@@ -228,7 +228,7 @@ public class SimpleTreeVisitor <R,P> implements TreeVisitor<R,P> {
return
defaultAction
(
node
,
p
);
return
defaultAction
(
node
,
p
);
}
}
public
R
visit
DisjunctiveType
(
Disjunctive
TypeTree
node
,
P
p
)
{
public
R
visit
UnionType
(
Union
TypeTree
node
,
P
p
)
{
return
defaultAction
(
node
,
p
);
return
defaultAction
(
node
,
p
);
}
}
...
...
src/share/classes/com/sun/source/util/TreeScanner.java
浏览文件 @
5ec39895
...
@@ -355,7 +355,7 @@ public class TreeScanner<R,P> implements TreeVisitor<R,P> {
...
@@ -355,7 +355,7 @@ public class TreeScanner<R,P> implements TreeVisitor<R,P> {
return
r
;
return
r
;
}
}
public
R
visit
DisjunctiveType
(
Disjunctive
TypeTree
node
,
P
p
)
{
public
R
visit
UnionType
(
Union
TypeTree
node
,
P
p
)
{
return
scan
(
node
.
getTypeAlternatives
(),
p
);
return
scan
(
node
.
getTypeAlternatives
(),
p
);
}
}
...
...
src/share/classes/com/sun/tools/javac/code/Flags.java
浏览文件 @
5ec39895
...
@@ -231,9 +231,9 @@ public class Flags {
...
@@ -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
disjunction var in a multi-catch clause
* Flag that marks a
a multi-catch parameter
*/
*/
public
static
final
long
DISJUNCT
ION
=
1L
<<
39
;
public
static
final
long
UN
ION
=
1L
<<
39
;
/**
/**
* Flag that marks a signature-polymorphic invoke method.
* Flag that marks a signature-polymorphic invoke method.
...
...
src/share/classes/com/sun/tools/javac/comp/Attr.java
浏览文件 @
5ec39895
...
@@ -1112,7 +1112,7 @@ public class Attr extends JCTree.Visitor {
...
@@ -1112,7 +1112,7 @@ public class Attr extends JCTree.Visitor {
Type
ctype
=
attribStat
(
c
.
param
,
catchEnv
);
Type
ctype
=
attribStat
(
c
.
param
,
catchEnv
);
if
(
TreeInfo
.
isMultiCatch
(
c
))
{
if
(
TreeInfo
.
isMultiCatch
(
c
))
{
//multi-catch parameter is implicitly marked as final
//multi-catch parameter is implicitly marked as final
c
.
param
.
sym
.
flags_field
|=
FINAL
|
DISJUNCT
ION
;
c
.
param
.
sym
.
flags_field
|=
FINAL
|
UN
ION
;
}
}
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
);
...
@@ -2908,7 +2908,7 @@ public class Attr extends JCTree.Visitor {
...
@@ -2908,7 +2908,7 @@ public class Attr extends JCTree.Visitor {
result
=
check
(
tree
,
owntype
,
TYP
,
pkind
,
pt
);
result
=
check
(
tree
,
owntype
,
TYP
,
pkind
,
pt
);
}
}
public
void
visitType
Disjunction
(
JCTypeDisjunct
ion
tree
)
{
public
void
visitType
Union
(
JCTypeUn
ion
tree
)
{
ListBuffer
<
Type
>
multicatchTypes
=
ListBuffer
.
lb
();
ListBuffer
<
Type
>
multicatchTypes
=
ListBuffer
.
lb
();
for
(
JCExpression
typeTree
:
tree
.
alternatives
)
{
for
(
JCExpression
typeTree
:
tree
.
alternatives
)
{
Type
ctype
=
attribType
(
typeTree
,
env
);
Type
ctype
=
attribType
(
typeTree
,
env
);
...
@@ -2916,7 +2916,7 @@ public class Attr extends JCTree.Visitor {
...
@@ -2916,7 +2916,7 @@ public class Attr extends JCTree.Visitor {
chk
.
checkClassType
(
typeTree
.
pos
(),
ctype
),
chk
.
checkClassType
(
typeTree
.
pos
(),
ctype
),
syms
.
throwableType
);
syms
.
throwableType
);
if
(!
ctype
.
isErroneous
())
{
if
(!
ctype
.
isErroneous
())
{
//check that alternatives of a
disjunctive
type are pairwise
//check that alternatives of a
union
type are pairwise
//unrelated w.r.t. subtyping
//unrelated w.r.t. subtyping
if
(
chk
.
intersects
(
ctype
,
multicatchTypes
.
toList
()))
{
if
(
chk
.
intersects
(
ctype
,
multicatchTypes
.
toList
()))
{
for
(
Type
t
:
multicatchTypes
)
{
for
(
Type
t
:
multicatchTypes
)
{
...
...
src/share/classes/com/sun/tools/javac/comp/Flow.java
浏览文件 @
5ec39895
...
@@ -381,7 +381,7 @@ public class Flow extends TreeScanner {
...
@@ -381,7 +381,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
()
&
DISJUNCT
ION
)
!=
0
)
{
//multi-catch parameter
if
((
sym
.
flags
()
&
UN
ION
)
!=
0
)
{
//multi-catch parameter
log
.
error
(
pos
,
"multicatch.parameter.may.not.be.assigned"
,
log
.
error
(
pos
,
"multicatch.parameter.may.not.be.assigned"
,
sym
);
sym
);
}
}
...
@@ -1003,7 +1003,7 @@ public class Flow extends TreeScanner {
...
@@ -1003,7 +1003,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
)
?
((
JCType
Disjunct
ion
)
l
.
head
.
param
.
vartype
).
alternatives
:
((
JCType
Un
ion
)
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
);
...
@@ -1075,7 +1075,7 @@ public class Flow extends TreeScanner {
...
@@ -1075,7 +1075,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
)
?
((
JCType
Disjunct
ion
)
l
.
head
.
param
.
vartype
).
alternatives
:
((
JCType
Un
ion
)
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
);
...
...
src/share/classes/com/sun/tools/javac/jvm/Gen.java
浏览文件 @
5ec39895
...
@@ -1456,7 +1456,7 @@ public class Gen extends JCTree.Visitor {
...
@@ -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
)
?
((
JCType
Disjunct
ion
)
tree
.
param
.
vartype
).
alternatives
:
((
JCType
Un
ion
)
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
)
{
...
...
src/share/classes/com/sun/tools/javac/parser/JavacParser.java
浏览文件 @
5ec39895
...
@@ -1837,7 +1837,7 @@ public class JavacParser implements Parser {
...
@@ -1837,7 +1837,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
()).
Type
Disjunct
ion
(
catchTypes
))
:
toP
(
F
.
at
(
catchTypes
.
head
.
getStartPosition
()).
Type
Un
ion
(
catchTypes
))
:
catchTypes
.
head
;
catchTypes
.
head
;
JCVariableDecl
formal
=
variableDeclaratorId
(
mods
,
paramType
);
JCVariableDecl
formal
=
variableDeclaratorId
(
mods
,
paramType
);
accept
(
RPAREN
);
accept
(
RPAREN
);
...
...
src/share/classes/com/sun/tools/javac/tree/JCTree.java
浏览文件 @
5ec39895
...
@@ -236,13 +236,13 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
...
@@ -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
;
/**
Disjunction types, of type TypeDisjunct
ion
/**
Union types, of type TypeUn
ion
*/
*/
public
static
final
int
TYPE
DISJUNCT
ION
=
TYPEAPPLY
+
1
;
public
static
final
int
TYPE
UN
ION
=
TYPEAPPLY
+
1
;
/** Formal type parameters, of type TypeParameter.
/** Formal type parameters, of type TypeParameter.
*/
*/
public
static
final
int
TYPEPARAMETER
=
TYPE
DISJUNCT
ION
+
1
;
public
static
final
int
TYPEPARAMETER
=
TYPE
UN
ION
+
1
;
/** Type argument.
/** Type argument.
*/
*/
...
@@ -1881,30 +1881,30 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
...
@@ -1881,30 +1881,30 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
}
}
/**
/**
* A
disjunct
ion type, T1 | T2 | ... Tn (used in multicatch statements)
* A
un
ion type, T1 | T2 | ... Tn (used in multicatch statements)
*/
*/
public
static
class
JCType
Disjunction
extends
JCExpression
implements
Disjunctive
TypeTree
{
public
static
class
JCType
Union
extends
JCExpression
implements
Union
TypeTree
{
public
List
<
JCExpression
>
alternatives
;
public
List
<
JCExpression
>
alternatives
;
protected
JCType
Disjunct
ion
(
List
<
JCExpression
>
components
)
{
protected
JCType
Un
ion
(
List
<
JCExpression
>
components
)
{
this
.
alternatives
=
components
;
this
.
alternatives
=
components
;
}
}
@Override
@Override
public
void
accept
(
Visitor
v
)
{
v
.
visitType
Disjunct
ion
(
this
);
}
public
void
accept
(
Visitor
v
)
{
v
.
visitType
Un
ion
(
this
);
}
public
Kind
getKind
()
{
return
Kind
.
DISJUNCTIVE
_TYPE
;
}
public
Kind
getKind
()
{
return
Kind
.
UNION
_TYPE
;
}
public
List
<
JCExpression
>
getTypeAlternatives
()
{
public
List
<
JCExpression
>
getTypeAlternatives
()
{
return
alternatives
;
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
.
visit
Disjunctive
Type
(
this
,
d
);
return
v
.
visit
Union
Type
(
this
,
d
);
}
}
@Override
@Override
public
int
getTag
()
{
public
int
getTag
()
{
return
TYPE
DISJUNCT
ION
;
return
TYPE
UN
ION
;
}
}
}
}
...
@@ -2227,7 +2227,7 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
...
@@ -2227,7 +2227,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
visitType
Disjunction
(
JCTypeDisjunction
that
)
{
visitTree
(
that
);
}
public
void
visitType
Union
(
JCTypeUnion
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
);
}
...
...
src/share/classes/com/sun/tools/javac/tree/Pretty.java
浏览文件 @
5ec39895
...
@@ -1169,7 +1169,7 @@ public class Pretty extends JCTree.Visitor {
...
@@ -1169,7 +1169,7 @@ public class Pretty extends JCTree.Visitor {
}
}
}
}
public
void
visitType
Disjunction
(
JCTypeDisjunct
ion
tree
)
{
public
void
visitType
Union
(
JCTypeUn
ion
tree
)
{
try
{
try
{
printExprs
(
tree
.
alternatives
,
" | "
);
printExprs
(
tree
.
alternatives
,
" | "
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
src/share/classes/com/sun/tools/javac/tree/TreeCopier.java
浏览文件 @
5ec39895
...
@@ -338,10 +338,10 @@ public class TreeCopier<P> implements TreeVisitor<JCTree,P> {
...
@@ -338,10 +338,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
visit
DisjunctiveType
(
Disjunctive
TypeTree
node
,
P
p
)
{
public
JCTree
visit
UnionType
(
Union
TypeTree
node
,
P
p
)
{
JCType
Disjunction
t
=
(
JCTypeDisjunct
ion
)
node
;
JCType
Union
t
=
(
JCTypeUn
ion
)
node
;
List
<
JCExpression
>
components
=
copy
(
t
.
alternatives
,
p
);
List
<
JCExpression
>
components
=
copy
(
t
.
alternatives
,
p
);
return
M
.
at
(
t
.
pos
).
Type
Disjunct
ion
(
components
);
return
M
.
at
(
t
.
pos
).
Type
Un
ion
(
components
);
}
}
public
JCTree
visitArrayType
(
ArrayTypeTree
node
,
P
p
)
{
public
JCTree
visitArrayType
(
ArrayTypeTree
node
,
P
p
)
{
...
...
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
浏览文件 @
5ec39895
...
@@ -119,7 +119,7 @@ public class TreeInfo {
...
@@ -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
.
TYPE
DISJUNCT
ION
;
return
catchClause
.
param
.
vartype
.
getTag
()
==
JCTree
.
TYPE
UN
ION
;
}
}
/** Is statement an initializer for a synthetic field?
/** Is statement an initializer for a synthetic field?
...
...
src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
浏览文件 @
5ec39895
...
@@ -435,8 +435,8 @@ public class TreeMaker implements JCTree.Factory {
...
@@ -435,8 +435,8 @@ public class TreeMaker implements JCTree.Factory {
return
tree
;
return
tree
;
}
}
public
JCType
Disjunction
TypeDisjunct
ion
(
List
<
JCExpression
>
components
)
{
public
JCType
Union
TypeUn
ion
(
List
<
JCExpression
>
components
)
{
JCType
Disjunction
tree
=
new
JCTypeDisjunct
ion
(
components
);
JCType
Union
tree
=
new
JCTypeUn
ion
(
components
);
tree
.
pos
=
pos
;
tree
.
pos
=
pos
;
return
tree
;
return
tree
;
}
}
...
...
src/share/classes/com/sun/tools/javac/tree/TreeScanner.java
浏览文件 @
5ec39895
...
@@ -272,7 +272,7 @@ public class TreeScanner extends Visitor {
...
@@ -272,7 +272,7 @@ public class TreeScanner extends Visitor {
scan
(
tree
.
arguments
);
scan
(
tree
.
arguments
);
}
}
public
void
visitType
Disjunction
(
JCTypeDisjunct
ion
tree
)
{
public
void
visitType
Union
(
JCTypeUn
ion
tree
)
{
scan
(
tree
.
alternatives
);
scan
(
tree
.
alternatives
);
}
}
...
...
src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java
浏览文件 @
5ec39895
...
@@ -363,7 +363,7 @@ public class TreeTranslator extends JCTree.Visitor {
...
@@ -363,7 +363,7 @@ public class TreeTranslator extends JCTree.Visitor {
result
=
tree
;
result
=
tree
;
}
}
public
void
visitType
Disjunction
(
JCTypeDisjunct
ion
tree
)
{
public
void
visitType
Union
(
JCTypeUn
ion
tree
)
{
tree
.
alternatives
=
translate
(
tree
.
alternatives
);
tree
.
alternatives
=
translate
(
tree
.
alternatives
);
result
=
tree
;
result
=
tree
;
}
}
...
...
src/share/classes/javax/lang/model/type/TypeKind.java
浏览文件 @
5ec39895
...
@@ -140,11 +140,11 @@ public enum TypeKind {
...
@@ -140,11 +140,11 @@ public enum TypeKind {
OTHER
,
OTHER
,
/**
/**
* A
disjunctive
type.
* A
union
type.
*
*
* @since 1.7
* @since 1.7
*/
*/
DISJUNCTIVE
;
UNION
;
/**
/**
* Returns {@code true} if this kind corresponds to a primitive
* Returns {@code true} if this kind corresponds to a primitive
...
...
src/share/classes/javax/lang/model/type/TypeVisitor.java
浏览文件 @
5ec39895
...
@@ -164,12 +164,12 @@ public interface TypeVisitor<R, P> {
...
@@ -164,12 +164,12 @@ public interface TypeVisitor<R, P> {
R
visitUnknown
(
TypeMirror
t
,
P
p
);
R
visitUnknown
(
TypeMirror
t
,
P
p
);
/**
/**
* Visits a
disjunctive
type.
* Visits a
union
type.
*
*
* @param t the type to visit
* @param t the type to visit
* @param p a visitor-specified parameter
* @param p a visitor-specified parameter
* @return a visitor-specified result
* @return a visitor-specified result
* @since 1.7
* @since 1.7
*/
*/
R
visit
Disjunctive
(
Disjunctive
Type
t
,
P
p
);
R
visit
Union
(
Union
Type
t
,
P
p
);
}
}
src/share/classes/javax/lang/model/type/
Disjunctive
Type.java
→
src/share/classes/javax/lang/model/type/
Union
Type.java
浏览文件 @
5ec39895
...
@@ -28,22 +28,20 @@ package javax.lang.model.type;
...
@@ -28,22 +28,20 @@ package javax.lang.model.type;
import
java.util.List
;
import
java.util.List
;
/**
/**
* Represents a
disjunctive
type.
* Represents a
union
type.
*
*
* As of the {@link javax.lang.model.SourceVersion#RELEASE_7
* As of the {@link javax.lang.model.SourceVersion#RELEASE_7
* RELEASE_7} source version,
disjunctive
types can appear as the type
* RELEASE_7} source version,
union
types can appear as the type
* of a multi-catch exception parameter.
* of a multi-catch exception parameter.
*
*
* @since 1.7
* @since 1.7
*/
*/
public
interface
Disjunctive
Type
extends
TypeMirror
{
public
interface
Union
Type
extends
TypeMirror
{
/**
/**
* Return the alternatives comprising this
disjunctive
type.
* Return the alternatives comprising this
union
type.
*
*
* The alternatives are formally referred to as <i>disjuncts</i>.
* @return the alternatives comprising this union type.
*
* @return the alternatives comprising this disjunctive type.
*/
*/
List
<?
extends
TypeMirror
>
getAlternatives
();
List
<?
extends
TypeMirror
>
getAlternatives
();
}
}
src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
浏览文件 @
5ec39895
...
@@ -96,7 +96,7 @@ public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
...
@@ -96,7 +96,7 @@ public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
}
}
/**
/**
* Visits a {@code
Disjunctive
Type} element by calling {@code
* Visits a {@code
Union
Type} element by calling {@code
* visitUnknown}.
* visitUnknown}.
* @param t {@inheritDoc}
* @param t {@inheritDoc}
...
@@ -105,7 +105,7 @@ public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
...
@@ -105,7 +105,7 @@ public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
*
*
* @since 1.7
* @since 1.7
*/
*/
public
R
visit
Disjunctive
(
Disjunctive
Type
t
,
P
p
)
{
public
R
visit
Union
(
Union
Type
t
,
P
p
)
{
return
visitUnknown
(
t
,
p
);
return
visitUnknown
(
t
,
p
);
}
}
...
...
src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java
浏览文件 @
5ec39895
...
@@ -67,11 +67,11 @@ public abstract class AbstractTypeVisitor7<R, P> extends AbstractTypeVisitor6<R,
...
@@ -67,11 +67,11 @@ public abstract class AbstractTypeVisitor7<R, P> extends AbstractTypeVisitor6<R,
}
}
/**
/**
* Visits a {@code
Disjunctive
Type} in a manner defined by a subclass.
* Visits a {@code
Union
Type} in a manner defined by a subclass.
*
*
* @param t {@inheritDoc}
* @param t {@inheritDoc}
* @param p {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of the visit as defined by a subclass
* @return the result of the visit as defined by a subclass
*/
*/
public
abstract
R
visit
Disjunctive
(
Disjunctive
Type
t
,
P
p
);
public
abstract
R
visit
Union
(
Union
Type
t
,
P
p
);
}
}
src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java
浏览文件 @
5ec39895
...
@@ -91,7 +91,7 @@ public class SimpleTypeVisitor7<R, P> extends SimpleTypeVisitor6<R, P> {
...
@@ -91,7 +91,7 @@ public class SimpleTypeVisitor7<R, P> extends SimpleTypeVisitor6<R, P> {
}
}
/**
/**
* This implementation visits a {@code
Disjunctive
Type} by calling
* This implementation visits a {@code
Union
Type} by calling
* {@code defaultAction}.
* {@code defaultAction}.
*
*
* @param t {@inheritDoc}
* @param t {@inheritDoc}
...
@@ -99,7 +99,7 @@ public class SimpleTypeVisitor7<R, P> extends SimpleTypeVisitor6<R, P> {
...
@@ -99,7 +99,7 @@ public class SimpleTypeVisitor7<R, P> extends SimpleTypeVisitor6<R, P> {
* @return the result of {@code defaultAction}
* @return the result of {@code defaultAction}
*/
*/
@Override
@Override
public
R
visit
Disjunctive
(
Disjunctive
Type
t
,
P
p
)
{
public
R
visit
Union
(
Union
Type
t
,
P
p
)
{
return
defaultAction
(
t
,
p
);
return
defaultAction
(
t
,
p
);
}
}
}
}
src/share/classes/javax/lang/model/util/TypeKindVisitor7.java
浏览文件 @
5ec39895
...
@@ -94,7 +94,7 @@ public class TypeKindVisitor7<R, P> extends TypeKindVisitor6<R, P> {
...
@@ -94,7 +94,7 @@ public class TypeKindVisitor7<R, P> extends TypeKindVisitor6<R, P> {
}
}
/**
/**
* This implementation visits a {@code
Disjunctive
Type} by calling
* This implementation visits a {@code
Union
Type} by calling
* {@code defaultAction}.
* {@code defaultAction}.
*
*
* @param t {@inheritDoc}
* @param t {@inheritDoc}
...
@@ -102,7 +102,7 @@ public class TypeKindVisitor7<R, P> extends TypeKindVisitor6<R, P> {
...
@@ -102,7 +102,7 @@ public class TypeKindVisitor7<R, P> extends TypeKindVisitor6<R, P> {
* @return the result of {@code defaultAction}
* @return the result of {@code defaultAction}
*/
*/
@Override
@Override
public
R
visit
Disjunctive
(
Disjunctive
Type
t
,
P
p
)
{
public
R
visit
Union
(
Union
Type
t
,
P
p
)
{
return
defaultAction
(
t
,
p
);
return
defaultAction
(
t
,
p
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录