Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
9c6d6ac0
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看板
提交
9c6d6ac0
编写于
12月 12, 2010
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6990134: minor (but red) findbugs warnings
Reviewed-by: mcimadamore
上级
3e973d62
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
39 addition
and
37 deletion
+39
-37
src/share/classes/com/sun/tools/apt/main/AptJavaCompiler.java
...share/classes/com/sun/tools/apt/main/AptJavaCompiler.java
+7
-7
src/share/classes/com/sun/tools/apt/main/Main.java
src/share/classes/com/sun/tools/apt/main/Main.java
+4
-4
src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java
...share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java
+2
-2
src/share/classes/com/sun/tools/javac/code/Type.java
src/share/classes/com/sun/tools/javac/code/Type.java
+10
-7
src/share/classes/com/sun/tools/javac/code/Types.java
src/share/classes/com/sun/tools/javac/code/Types.java
+15
-15
src/share/classes/com/sun/tools/javac/comp/Resolve.java
src/share/classes/com/sun/tools/javac/comp/Resolve.java
+1
-2
未找到文件。
src/share/classes/com/sun/tools/apt/main/JavaCompiler.java
→
src/share/classes/com/sun/tools/apt/main/
Apt
JavaCompiler.java
浏览文件 @
9c6d6ac0
...
@@ -51,16 +51,16 @@ import com.sun.tools.javac.parser.DocCommentScanner;
...
@@ -51,16 +51,16 @@ import com.sun.tools.javac.parser.DocCommentScanner;
* or deletion without notice.</b>
* or deletion without notice.</b>
*/
*/
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
class
JavaCompiler
extends
com
.
sun
.
tools
.
javac
.
main
.
JavaCompiler
{
public
class
Apt
JavaCompiler
extends
com
.
sun
.
tools
.
javac
.
main
.
JavaCompiler
{
/** The context key for the compiler. */
/** The context key for the compiler. */
protected
static
final
Context
.
Key
<
JavaCompiler
>
compilerKey
=
protected
static
final
Context
.
Key
<
Apt
JavaCompiler
>
compilerKey
=
new
Context
.
Key
<
JavaCompiler
>();
new
Context
.
Key
<
Apt
JavaCompiler
>();
/** Get the JavaCompiler instance for this context. */
/** Get the JavaCompiler instance for this context. */
public
static
JavaCompiler
instance
(
Context
context
)
{
public
static
Apt
JavaCompiler
instance
(
Context
context
)
{
JavaCompiler
instance
=
context
.
get
(
compilerKey
);
Apt
JavaCompiler
instance
=
context
.
get
(
compilerKey
);
if
(
instance
==
null
)
if
(
instance
==
null
)
instance
=
new
JavaCompiler
(
context
);
instance
=
new
Apt
JavaCompiler
(
context
);
return
instance
;
return
instance
;
}
}
...
@@ -107,7 +107,7 @@ public class JavaCompiler extends com.sun.tools.javac.main.JavaCompiler {
...
@@ -107,7 +107,7 @@ public class JavaCompiler extends com.sun.tools.javac.main.JavaCompiler {
/** Construct a new compiler from a shared context.
/** Construct a new compiler from a shared context.
*/
*/
public
JavaCompiler
(
Context
context
)
{
public
Apt
JavaCompiler
(
Context
context
)
{
super
(
preRegister
(
context
));
super
(
preRegister
(
context
));
context
.
put
(
compilerKey
,
this
);
context
.
put
(
compilerKey
,
this
);
...
...
src/share/classes/com/sun/tools/apt/main/Main.java
浏览文件 @
9c6d6ac0
...
@@ -421,7 +421,7 @@ public class Main {
...
@@ -421,7 +421,7 @@ public class Main {
},
},
new
AptOption
(
"-version"
,
"opt.version"
)
{
new
AptOption
(
"-version"
,
"opt.version"
)
{
boolean
process
(
String
option
)
{
boolean
process
(
String
option
)
{
Bark
.
printLines
(
out
,
ownName
+
" "
+
JavaCompiler
.
version
());
Bark
.
printLines
(
out
,
ownName
+
" "
+
Apt
JavaCompiler
.
version
());
return
super
.
process
(
option
);
return
super
.
process
(
option
);
}
}
},
},
...
@@ -1111,11 +1111,11 @@ public class Main {
...
@@ -1111,11 +1111,11 @@ public class Main {
}
}
int
exitCode
=
EXIT_OK
;
int
exitCode
=
EXIT_OK
;
JavaCompiler
comp
=
null
;
Apt
JavaCompiler
comp
=
null
;
try
{
try
{
context
.
put
(
Bark
.
outKey
,
out
);
context
.
put
(
Bark
.
outKey
,
out
);
comp
=
JavaCompiler
.
instance
(
context
);
comp
=
Apt
JavaCompiler
.
instance
(
context
);
if
(
comp
==
null
)
if
(
comp
==
null
)
return
EXIT_SYSERR
;
return
EXIT_SYSERR
;
...
@@ -1184,7 +1184,7 @@ public class Main {
...
@@ -1184,7 +1184,7 @@ public class Main {
*/
*/
void
bugMessage
(
Throwable
ex
)
{
void
bugMessage
(
Throwable
ex
)
{
Bark
.
printLines
(
out
,
getLocalizedString
(
"msg.bug"
,
Bark
.
printLines
(
out
,
getLocalizedString
(
"msg.bug"
,
JavaCompiler
.
version
()));
Apt
JavaCompiler
.
version
()));
ex
.
printStackTrace
(
out
);
ex
.
printStackTrace
(
out
);
}
}
...
...
src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java
浏览文件 @
9c6d6ac0
...
@@ -120,7 +120,7 @@ public class FilerImpl implements Filer {
...
@@ -120,7 +120,7 @@ public class FilerImpl implements Filer {
private
final
Options
opts
;
private
final
Options
opts
;
private
final
DeclarationMaker
declMaker
;
private
final
DeclarationMaker
declMaker
;
private
final
com
.
sun
.
tools
.
apt
.
main
.
JavaCompiler
comp
;
private
final
com
.
sun
.
tools
.
apt
.
main
.
Apt
JavaCompiler
comp
;
// Platform's default encoding
// Platform's default encoding
private
final
static
String
DEFAULT_ENCODING
=
private
final
static
String
DEFAULT_ENCODING
=
...
@@ -177,7 +177,7 @@ public class FilerImpl implements Filer {
...
@@ -177,7 +177,7 @@ public class FilerImpl implements Filer {
opts
=
Options
.
instance
(
context
);
opts
=
Options
.
instance
(
context
);
declMaker
=
DeclarationMaker
.
instance
(
context
);
declMaker
=
DeclarationMaker
.
instance
(
context
);
bark
=
Bark
.
instance
(
context
);
bark
=
Bark
.
instance
(
context
);
comp
=
com
.
sun
.
tools
.
apt
.
main
.
JavaCompiler
.
instance
(
context
);
comp
=
com
.
sun
.
tools
.
apt
.
main
.
Apt
JavaCompiler
.
instance
(
context
);
roundOver
=
false
;
roundOver
=
false
;
this
.
filesCreated
=
comp
.
getAggregateGenFiles
();
this
.
filesCreated
=
comp
.
getAggregateGenFiles
();
...
...
src/share/classes/com/sun/tools/javac/code/Type.java
浏览文件 @
9c6d6ac0
...
@@ -245,7 +245,7 @@ public class Type implements PrimitiveType {
...
@@ -245,7 +245,7 @@ public class Type implements PrimitiveType {
public
String
argtypes
(
boolean
varargs
)
{
public
String
argtypes
(
boolean
varargs
)
{
List
<
Type
>
args
=
getParameterTypes
();
List
<
Type
>
args
=
getParameterTypes
();
if
(!
varargs
)
return
args
.
toString
();
if
(!
varargs
)
return
args
.
toString
();
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
while
(
args
.
tail
.
nonEmpty
())
{
while
(
args
.
tail
.
nonEmpty
())
{
buf
.
append
(
args
.
head
);
buf
.
append
(
args
.
head
);
args
=
args
.
tail
;
args
=
args
.
tail
;
...
@@ -935,7 +935,7 @@ public class Type implements PrimitiveType {
...
@@ -935,7 +935,7 @@ public class Type implements PrimitiveType {
public
static
class
TypeVar
extends
Type
implements
TypeVariable
{
public
static
class
TypeVar
extends
Type
implements
TypeVariable
{
/** The bound of this type variable; set from outside.
/** The
upper
bound of this type variable; set from outside.
* Must be nonempty once it is set.
* Must be nonempty once it is set.
* For a bound, `bound' is the bound type itself.
* For a bound, `bound' is the bound type itself.
* Multiple bounds are expressed as a single class type which has the
* Multiple bounds are expressed as a single class type which has the
...
@@ -946,6 +946,12 @@ public class Type implements PrimitiveType {
...
@@ -946,6 +946,12 @@ public class Type implements PrimitiveType {
* points to the first class or interface bound.
* points to the first class or interface bound.
*/
*/
public
Type
bound
=
null
;
public
Type
bound
=
null
;
/** The lower bound of this type variable.
* TypeVars don't normally have a lower bound, so it is normally set
* to syms.botType.
* Subtypes, such as CapturedType, may provide a different value.
*/
public
Type
lower
;
public
Type
lower
;
public
TypeVar
(
Name
name
,
Symbol
owner
,
Type
lower
)
{
public
TypeVar
(
Name
name
,
Symbol
owner
,
Type
lower
)
{
...
@@ -965,10 +971,12 @@ public class Type implements PrimitiveType {
...
@@ -965,10 +971,12 @@ public class Type implements PrimitiveType {
return
v
.
visitTypeVar
(
this
,
s
);
return
v
.
visitTypeVar
(
this
,
s
);
}
}
@Override
public
Type
getUpperBound
()
{
return
bound
;
}
public
Type
getUpperBound
()
{
return
bound
;
}
int
rank_field
=
-
1
;
int
rank_field
=
-
1
;
@Override
public
Type
getLowerBound
()
{
public
Type
getLowerBound
()
{
return
lower
;
return
lower
;
}
}
...
@@ -992,7 +1000,6 @@ public class Type implements PrimitiveType {
...
@@ -992,7 +1000,6 @@ public class Type implements PrimitiveType {
*/
*/
public
static
class
CapturedType
extends
TypeVar
{
public
static
class
CapturedType
extends
TypeVar
{
public
Type
lower
;
public
WildcardType
wildcard
;
public
WildcardType
wildcard
;
public
CapturedType
(
Name
name
,
public
CapturedType
(
Name
name
,
...
@@ -1012,10 +1019,6 @@ public class Type implements PrimitiveType {
...
@@ -1012,10 +1019,6 @@ public class Type implements PrimitiveType {
return
v
.
visitCapturedType
(
this
,
s
);
return
v
.
visitCapturedType
(
this
,
s
);
}
}
public
Type
getLowerBound
()
{
return
lower
;
}
@Override
@Override
public
boolean
isCaptured
()
{
public
boolean
isCaptured
()
{
return
true
;
return
true
;
...
...
src/share/classes/com/sun/tools/javac/code/Types.java
浏览文件 @
9c6d6ac0
...
@@ -641,7 +641,7 @@ public class Types {
...
@@ -641,7 +641,7 @@ public class Types {
if
(!
set
.
remove
(
new
SingletonType
(
x
)))
if
(!
set
.
remove
(
new
SingletonType
(
x
)))
return
false
;
return
false
;
}
}
return
(
set
.
size
()
==
0
);
return
(
set
.
isEmpty
()
);
}
}
return
t
.
tsym
==
s
.
tsym
return
t
.
tsym
==
s
.
tsym
&&
visit
(
t
.
getEnclosingType
(),
s
.
getEnclosingType
())
&&
visit
(
t
.
getEnclosingType
(),
s
.
getEnclosingType
())
...
@@ -838,26 +838,26 @@ public class Types {
...
@@ -838,26 +838,26 @@ public class Types {
return
isSameType
(
t
,
s
);
return
isSameType
(
t
,
s
);
}
}
void
debugContainsType
(
WildcardType
t
,
Type
s
)
{
//
void debugContainsType(WildcardType t, Type s) {
System
.
err
.
println
();
//
System.err.println();
System
.
err
.
format
(
" does %s contain %s?%n"
,
t
,
s
);
//
System.err.format(" does %s contain %s?%n", t, s);
System
.
err
.
format
(
" %s U(%s) <: U(%s) %s = %s%n"
,
//
System.err.format(" %s U(%s) <: U(%s) %s = %s%n",
upperBound
(
s
),
s
,
t
,
U
(
t
),
//
upperBound(s), s, t, U(t),
t
.
isSuperBound
()
//
t.isSuperBound()
||
isSubtypeNoCapture
(
upperBound
(
s
),
U
(
t
)));
//
|| isSubtypeNoCapture(upperBound(s), U(t)));
System
.
err
.
format
(
" %s L(%s) <: L(%s) %s = %s%n"
,
//
System.err.format(" %s L(%s) <: L(%s) %s = %s%n",
L
(
t
),
t
,
s
,
lowerBound
(
s
),
//
L(t), t, s, lowerBound(s),
t
.
isExtendsBound
()
//
t.isExtendsBound()
||
isSubtypeNoCapture
(
L
(
t
),
lowerBound
(
s
)));
//
|| isSubtypeNoCapture(L(t), lowerBound(s)));
System
.
err
.
println
();
//
System.err.println();
}
//
}
@Override
@Override
public
Boolean
visitWildcardType
(
WildcardType
t
,
Type
s
)
{
public
Boolean
visitWildcardType
(
WildcardType
t
,
Type
s
)
{
if
(
s
.
tag
>=
firstPartialTag
)
if
(
s
.
tag
>=
firstPartialTag
)
return
containedBy
(
s
,
t
);
return
containedBy
(
s
,
t
);
else
{
else
{
//
debugContainsType(t, s);
//
debugContainsType(t, s);
return
isSameWildcard
(
t
,
s
)
return
isSameWildcard
(
t
,
s
)
||
isCaptureOf
(
s
,
t
)
||
isCaptureOf
(
s
,
t
)
||
((
t
.
isExtendsBound
()
||
isSubtypeNoCapture
(
L
(
t
),
lowerBound
(
s
)))
&&
||
((
t
.
isExtendsBound
()
||
isSubtypeNoCapture
(
L
(
t
),
lowerBound
(
s
)))
&&
...
...
src/share/classes/com/sun/tools/javac/comp/Resolve.java
浏览文件 @
9c6d6ac0
...
@@ -197,7 +197,7 @@ public class Resolve {
...
@@ -197,7 +197,7 @@ public class Resolve {
}
}
return
(
checkInner
==
false
||
c
.
type
.
getEnclosingType
()
==
Type
.
noType
)
?
return
(
checkInner
==
false
||
c
.
type
.
getEnclosingType
()
==
Type
.
noType
)
?
isAccessible
:
isAccessible
:
isAccessible
&
isAccessible
(
env
,
c
.
type
.
getEnclosingType
(),
checkInner
);
isAccessible
&
&
isAccessible
(
env
,
c
.
type
.
getEnclosingType
(),
checkInner
);
}
}
//where
//where
/** Is given class a subclass of given base class, or an inner class
/** Is given class a subclass of given base class, or an inner class
...
@@ -234,7 +234,6 @@ public class Resolve {
...
@@ -234,7 +234,6 @@ public class Resolve {
}
}
public
boolean
isAccessible
(
Env
<
AttrContext
>
env
,
Type
site
,
Symbol
sym
,
boolean
checkInner
)
{
public
boolean
isAccessible
(
Env
<
AttrContext
>
env
,
Type
site
,
Symbol
sym
,
boolean
checkInner
)
{
if
(
sym
.
name
==
names
.
init
&&
sym
.
owner
!=
site
.
tsym
)
return
false
;
if
(
sym
.
name
==
names
.
init
&&
sym
.
owner
!=
site
.
tsym
)
return
false
;
ClassSymbol
sub
;
switch
((
short
)(
sym
.
flags
()
&
AccessFlags
))
{
switch
((
short
)(
sym
.
flags
()
&
AccessFlags
))
{
case
PRIVATE:
case
PRIVATE:
return
return
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录