Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
ce6ac034
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看板
提交
ce6ac034
编写于
8月 11, 2009
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
1cf04c57
676dd771
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
817 addition
and
68 deletion
+817
-68
src/share/classes/com/sun/tools/javac/code/Symtab.java
src/share/classes/com/sun/tools/javac/code/Symtab.java
+2
-1
src/share/classes/com/sun/tools/javac/code/Types.java
src/share/classes/com/sun/tools/javac/code/Types.java
+10
-6
src/share/classes/com/sun/tools/javac/comp/Attr.java
src/share/classes/com/sun/tools/javac/comp/Attr.java
+18
-10
src/share/classes/com/sun/tools/javac/comp/Check.java
src/share/classes/com/sun/tools/javac/comp/Check.java
+49
-11
src/share/classes/com/sun/tools/javac/comp/Lower.java
src/share/classes/com/sun/tools/javac/comp/Lower.java
+43
-20
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
+1
-1
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
+17
-5
src/share/classes/com/sun/tools/javac/resources/compiler.properties
...classes/com/sun/tools/javac/resources/compiler.properties
+21
-9
test/tools/javac/6390045/T6390045a.java
test/tools/javac/6390045/T6390045a.java
+38
-0
test/tools/javac/6390045/T6390045b.java
test/tools/javac/6390045/T6390045b.java
+38
-0
test/tools/javac/6521805/T6521805a.java
test/tools/javac/6521805/T6521805a.java
+45
-0
test/tools/javac/6521805/T6521805a_1.out
test/tools/javac/6521805/T6521805a_1.out
+2
-0
test/tools/javac/6521805/T6521805a_2.out
test/tools/javac/6521805/T6521805a_2.out
+2
-0
test/tools/javac/6521805/T6521805b.java
test/tools/javac/6521805/T6521805b.java
+44
-0
test/tools/javac/6521805/T6521805c.java
test/tools/javac/6521805/T6521805c.java
+44
-0
test/tools/javac/6521805/T6521805d.java
test/tools/javac/6521805/T6521805d.java
+50
-0
test/tools/javac/6521805/T6521805d.out
test/tools/javac/6521805/T6521805d.out
+2
-0
test/tools/javac/6521805/T6521805e.java
test/tools/javac/6521805/T6521805e.java
+32
-0
test/tools/javac/6521805/T6521805e.out
test/tools/javac/6521805/T6521805e.out
+2
-0
test/tools/javac/6521805/p/Outer.java
test/tools/javac/6521805/p/Outer.java
+5
-0
test/tools/javac/6521805/p/Sub.java
test/tools/javac/6521805/p/Sub.java
+13
-0
test/tools/javac/6734819/T6734819a.out
test/tools/javac/6734819/T6734819a.out
+2
-2
test/tools/javac/6734819/T6734819b.out
test/tools/javac/6734819/T6734819b.out
+1
-1
test/tools/javac/6840059/T6840059.java
test/tools/javac/6840059/T6840059.java
+40
-0
test/tools/javac/6840059/T6840059.out
test/tools/javac/6840059/T6840059.out
+3
-0
test/tools/javac/OverrideChecks/6199153/T6199153.java
test/tools/javac/OverrideChecks/6199153/T6199153.java
+44
-0
test/tools/javac/OverrideChecks/6199153/T6199153.out
test/tools/javac/OverrideChecks/6199153/T6199153.out
+4
-0
test/tools/javac/generics/T6869075.java
test/tools/javac/generics/T6869075.java
+67
-0
test/tools/javac/generics/typevars/6569404/T6569404a.java
test/tools/javac/generics/typevars/6569404/T6569404a.java
+46
-0
test/tools/javac/generics/typevars/6569404/T6569404b.java
test/tools/javac/generics/typevars/6569404/T6569404b.java
+41
-0
test/tools/javac/generics/typevars/6569404/T6569404b.out
test/tools/javac/generics/typevars/6569404/T6569404b.out
+2
-0
test/tools/javac/generics/typevars/6569404/T6569404c.java
test/tools/javac/generics/typevars/6569404/T6569404c.java
+43
-0
test/tools/javac/policy/test2/byfile.AB.out
test/tools/javac/policy/test2/byfile.AB.out
+1
-1
test/tools/javac/policy/test2/bytodo.AB.out
test/tools/javac/policy/test2/bytodo.AB.out
+1
-1
test/tools/javac/varargs/6806876/T6806876.java
test/tools/javac/varargs/6806876/T6806876.java
+40
-0
test/tools/javac/varargs/6806876/T6806876.out
test/tools/javac/varargs/6806876/T6806876.out
+4
-0
未找到文件。
src/share/classes/com/sun/tools/javac/code/Symtab.java
浏览文件 @
ce6ac034
...
...
@@ -193,7 +193,7 @@ public class Symtab {
public
void
initType
(
Type
type
,
String
name
,
String
bname
)
{
initType
(
type
,
name
);
boxedName
[
type
.
tag
]
=
names
.
fromString
(
"java.lang."
+
bname
);
boxedName
[
type
.
tag
]
=
names
.
fromString
(
"java.lang."
+
bname
);
}
/** The class symbol that owns all predefined symbols.
...
...
@@ -467,6 +467,7 @@ public class Symtab {
synthesizeMHTypeIfMissing
(
invokeDynamicType
);
synthesizeBoxTypeIfMissing
(
doubleType
);
synthesizeBoxTypeIfMissing
(
floatType
);
synthesizeBoxTypeIfMissing
(
voidType
);
// Enter a synthetic class that is used to mark Sun
// proprietary classes in ct.sym. This class does not have a
...
...
src/share/classes/com/sun/tools/javac/code/Types.java
浏览文件 @
ce6ac034
...
...
@@ -1247,14 +1247,18 @@ public class Types {
@Override
public
Boolean
visitClassType
(
ClassType
t
,
Void
ignored
)
{
if
(!
t
.
isParameterized
())
return
true
;
if
(
t
.
isCompound
())
return
false
;
else
{
if
(!
t
.
isParameterized
())
return
true
;
for
(
Type
param
:
t
.
allparams
())
{
if
(!
param
.
isUnbound
())
return
false
;
for
(
Type
param
:
t
.
allparams
())
{
if
(!
param
.
isUnbound
())
return
false
;
}
return
true
;
}
return
true
;
}
@Override
...
...
src/share/classes/com/sun/tools/javac/comp/Attr.java
浏览文件 @
ce6ac034
...
...
@@ -1239,7 +1239,10 @@ public class Attr extends JCTree.Visitor {
}
if
(
site
.
tag
==
CLASS
)
{
if
(
site
.
getEnclosingType
().
tag
==
CLASS
)
{
Type
encl
=
site
.
getEnclosingType
();
while
(
encl
!=
null
&&
encl
.
tag
==
TYPEVAR
)
encl
=
encl
.
getUpperBound
();
if
(
encl
.
tag
==
CLASS
)
{
// we are calling a nested class
if
(
tree
.
meth
.
getTag
()
==
JCTree
.
SELECT
)
{
...
...
@@ -1251,7 +1254,7 @@ public class Attr extends JCTree.Visitor {
// to the outer instance type of the class.
chk
.
checkRefType
(
qualifier
.
pos
(),
attribExpr
(
qualifier
,
localEnv
,
site
.
getEnclosingType
()
));
encl
));
}
else
if
(
methName
==
names
.
_super
)
{
// qualifier omitted; check for existence
// of an appropriate implicit qualifier.
...
...
@@ -1554,13 +1557,18 @@ public class Attr extends JCTree.Visitor {
typeargtypes
,
true
,
tree
.
varargsElement
!=
null
);
assert
sym
.
kind
<
AMBIGUOUS
||
tree
.
constructor
.
type
.
isErroneous
();
tree
.
constructor
=
sym
;
tree
.
constructorType
=
checkMethod
(
clazztype
,
tree
.
constructor
,
localEnv
,
tree
.
args
,
argtypes
,
typeargtypes
,
localEnv
.
info
.
varArgs
);
if
(
tree
.
constructor
.
kind
>
ERRONEOUS
)
{
tree
.
constructorType
=
syms
.
errType
;
}
else
{
tree
.
constructorType
=
checkMethod
(
clazztype
,
tree
.
constructor
,
localEnv
,
tree
.
args
,
argtypes
,
typeargtypes
,
localEnv
.
info
.
varArgs
);
}
}
if
(
tree
.
constructor
!=
null
&&
tree
.
constructor
.
kind
==
MTH
)
...
...
@@ -2037,7 +2045,7 @@ public class Attr extends JCTree.Visitor {
Symbol
sym
=
(
site
.
getUpperBound
()
!=
null
)
?
selectSym
(
tree
,
capture
(
site
.
getUpperBound
()),
env
,
pt
,
pkind
)
:
null
;
if
(
sym
==
null
||
isType
(
sym
)
)
{
if
(
sym
==
null
)
{
log
.
error
(
pos
,
"type.var.cant.be.deref"
);
return
syms
.
errSymbol
;
}
else
{
...
...
src/share/classes/com/sun/tools/javac/comp/Check.java
浏览文件 @
ce6ac034
...
...
@@ -65,6 +65,7 @@ public class Check {
private
final
Types
types
;
private
final
JCDiagnostic
.
Factory
diags
;
private
final
boolean
skipAnnotations
;
private
boolean
warnOnSyntheticConflicts
;
private
final
TreeInfo
treeinfo
;
// The set of lint options currently in effect. It is initialized
...
...
@@ -99,6 +100,7 @@ public class Check {
allowAnnotations
=
source
.
allowAnnotations
();
complexInference
=
options
.
get
(
"-complexinference"
)
!=
null
;
skipAnnotations
=
options
.
get
(
"skipAnnotations"
)
!=
null
;
warnOnSyntheticConflicts
=
options
.
get
(
"warnOnSyntheticConflicts"
)
!=
null
;
boolean
verboseDeprecated
=
lint
.
isEnabled
(
LintCategory
.
DEPRECATION
);
boolean
verboseUnchecked
=
lint
.
isEnabled
(
LintCategory
.
UNCHECKED
);
...
...
@@ -1041,7 +1043,7 @@ public class Check {
* @param thrown The list of thrown exceptions.
* @param handled The list of handled exceptions.
*/
List
<
Type
>
un
H
andled
(
List
<
Type
>
thrown
,
List
<
Type
>
handled
)
{
List
<
Type
>
un
h
andled
(
List
<
Type
>
thrown
,
List
<
Type
>
handled
)
{
List
<
Type
>
unhandled
=
List
.
nil
();
for
(
List
<
Type
>
l
=
thrown
;
l
.
nonEmpty
();
l
=
l
.
tail
)
if
(!
isHandled
(
l
.
head
,
handled
))
unhandled
=
unhandled
.
prepend
(
l
.
head
);
...
...
@@ -1198,29 +1200,36 @@ public class Check {
m
.
owner
.
isSubClass
(
other
.
owner
,
types
))
{
// allow limited interoperability with covariant returns
}
else
{
typeE
rror
(
TreeInfo
.
diagnosticPositionFor
(
m
,
tree
),
diags
.
fragment
(
"override.incompatible.ret"
,
cannotOverride
(
m
,
other
)
),
log
.
e
rror
(
TreeInfo
.
diagnosticPositionFor
(
m
,
tree
),
"override.incompatible.ret"
,
cannotOverride
(
m
,
other
),
mtres
,
otres
);
return
;
}
}
else
if
(
overrideWarner
.
warned
)
{
warnUnchecked
(
TreeInfo
.
diagnosticPositionFor
(
m
,
tree
),
"prob.found.req"
,
diags
.
fragment
(
"override.unchecked.ret"
,
uncheckedOverrides
(
m
,
other
)),
mtres
,
otres
);
"override.unchecked.ret"
,
uncheckedOverrides
(
m
,
other
),
mtres
,
otres
);
}
// Error if overriding method throws an exception not reported
// by overridden method.
List
<
Type
>
otthrown
=
types
.
subst
(
ot
.
getThrownTypes
(),
otvars
,
mtvars
);
List
<
Type
>
unhandled
=
unHandled
(
mt
.
getThrownTypes
(),
otthrown
);
if
(
unhandled
.
nonEmpty
())
{
List
<
Type
>
unhandledErased
=
unhandled
(
mt
.
getThrownTypes
(),
types
.
erasure
(
otthrown
));
List
<
Type
>
unhandledUnerased
=
unhandled
(
mt
.
getThrownTypes
(),
otthrown
);
if
(
unhandledErased
.
nonEmpty
())
{
log
.
error
(
TreeInfo
.
diagnosticPositionFor
(
m
,
tree
),
"override.meth.doesnt.throw"
,
cannotOverride
(
m
,
other
),
unhandled
.
head
);
unhandledUnerased
.
head
);
return
;
}
else
if
(
unhandledUnerased
.
nonEmpty
())
{
warnUnchecked
(
TreeInfo
.
diagnosticPositionFor
(
m
,
tree
),
"override.unchecked.thrown"
,
cannotOverride
(
m
,
other
),
unhandledUnerased
.
head
);
return
;
}
...
...
@@ -1709,6 +1718,35 @@ public class Check {
checkCompatibleConcretes
(
pos
,
c
);
}
void
checkConflicts
(
DiagnosticPosition
pos
,
Symbol
sym
,
TypeSymbol
c
)
{
for
(
Type
ct
=
c
.
type
;
ct
!=
Type
.
noType
;
ct
=
types
.
supertype
(
ct
))
{
for
(
Scope
.
Entry
e
=
ct
.
tsym
.
members
().
lookup
(
sym
.
name
);
e
.
scope
==
ct
.
tsym
.
members
();
e
=
e
.
next
())
{
// VM allows methods and variables with differing types
if
(
sym
.
kind
==
e
.
sym
.
kind
&&
types
.
isSameType
(
types
.
erasure
(
sym
.
type
),
types
.
erasure
(
e
.
sym
.
type
))
&&
sym
!=
e
.
sym
&&
(
sym
.
flags
()
&
Flags
.
SYNTHETIC
)
!=
(
e
.
sym
.
flags
()
&
Flags
.
SYNTHETIC
)
&&
(
sym
.
flags
()
&
BRIDGE
)
==
0
&&
(
e
.
sym
.
flags
()
&
BRIDGE
)
==
0
)
{
syntheticError
(
pos
,
(
e
.
sym
.
flags
()
&
SYNTHETIC
)
==
0
?
e
.
sym
:
sym
);
return
;
}
}
}
}
/** Report a conflict between a user symbol and a synthetic symbol.
*/
private
void
syntheticError
(
DiagnosticPosition
pos
,
Symbol
sym
)
{
if
(!
sym
.
type
.
isErroneous
())
{
if
(
warnOnSyntheticConflicts
)
{
log
.
warning
(
pos
,
"synthetic.name.conflict"
,
sym
,
sym
.
location
());
}
else
{
log
.
error
(
pos
,
"synthetic.name.conflict"
,
sym
,
sym
.
location
());
}
}
}
/** Check that class c does not implement directly or indirectly
* the same parameterized interface with two different argument lists.
* @param pos Position to be used for error reporting.
...
...
src/share/classes/com/sun/tools/javac/comp/Lower.java
浏览文件 @
ce6ac034
...
...
@@ -596,35 +596,57 @@ public class Lower extends TreeTranslator {
* Symbol manipulation utilities
*************************************************************************/
/** Report a conflict between a user symbol and a synthetic symbol.
*/
private
void
duplicateError
(
DiagnosticPosition
pos
,
Symbol
sym
)
{
if
(!
sym
.
type
.
isErroneous
())
{
log
.
error
(
pos
,
"synthetic.name.conflict"
,
sym
,
sym
.
location
());
}
}
/** Enter a synthetic symbol in a given scope, but complain if there was already one there.
* @param pos Position for error reporting.
* @param sym The symbol.
* @param s The scope.
*/
private
void
enterSynthetic
(
DiagnosticPosition
pos
,
Symbol
sym
,
Scope
s
)
{
if
(
sym
.
name
!=
names
.
error
&&
sym
.
name
!=
names
.
empty
)
{
for
(
Scope
.
Entry
e
=
s
.
lookup
(
sym
.
name
);
e
.
scope
==
s
;
e
=
e
.
next
())
{
if
(
sym
!=
e
.
sym
&&
sym
.
kind
==
e
.
sym
.
kind
)
{
// VM allows methods and variables with differing types
if
((
sym
.
kind
&
(
MTH
|
VAR
))
!=
0
&&
!
types
.
erasure
(
sym
.
type
).
equals
(
types
.
erasure
(
e
.
sym
.
type
)))
continue
;
duplicateError
(
pos
,
e
.
sym
);
break
;
}
}
}
s
.
enter
(
sym
);
}
/** Check whether synthetic symbols generated during lowering conflict
* with user-defined symbols.
*
* @param translatedTrees lowered class trees
*/
void
checkConflicts
(
List
<
JCTree
>
translatedTrees
)
{
for
(
JCTree
t
:
translatedTrees
)
{
t
.
accept
(
conflictsChecker
);
}
}
JCTree
.
Visitor
conflictsChecker
=
new
TreeScanner
()
{
TypeSymbol
currentClass
;
@Override
public
void
visitMethodDef
(
JCMethodDecl
that
)
{
chk
.
checkConflicts
(
that
.
pos
(),
that
.
sym
,
currentClass
);
super
.
visitMethodDef
(
that
);
}
@Override
public
void
visitVarDef
(
JCVariableDecl
that
)
{
if
(
that
.
sym
.
owner
.
kind
==
TYP
)
{
chk
.
checkConflicts
(
that
.
pos
(),
that
.
sym
,
currentClass
);
}
super
.
visitVarDef
(
that
);
}
@Override
public
void
visitClassDef
(
JCClassDecl
that
)
{
TypeSymbol
prevCurrentClass
=
currentClass
;
currentClass
=
that
.
sym
;
try
{
super
.
visitClassDef
(
that
);
}
finally
{
currentClass
=
prevCurrentClass
;
}
}
};
/** Look up a synthetic name in a given scope.
* @param scope The scope.
* @param name The name.
...
...
@@ -3192,6 +3214,7 @@ public class Lower extends TreeTranslator {
makeAccessible
(
l
.
head
);
for
(
EnumMapping
map
:
enumSwitchMap
.
values
())
map
.
translate
();
checkConflicts
(
this
.
translated
.
toList
());
translated
=
this
.
translated
;
}
finally
{
// note that recursive invocations of this method fail hard
...
...
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
浏览文件 @
ce6ac034
...
...
@@ -631,7 +631,7 @@ public class TransTypes extends TreeTranslator {
}
public
void
visitAssignop
(
JCAssignOp
tree
)
{
tree
.
lhs
=
translate
(
tree
.
lhs
,
tree
.
operator
.
type
.
getParameterTypes
().
head
);
tree
.
lhs
=
translate
(
tree
.
lhs
,
null
);
tree
.
rhs
=
translate
(
tree
.
rhs
,
tree
.
operator
.
type
.
getParameterTypes
().
tail
.
head
);
tree
.
type
=
erasure
(
tree
.
type
);
result
=
tree
;
...
...
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
浏览文件 @
ce6ac034
...
...
@@ -1207,6 +1207,9 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
return
stopIfError
(
CompileState
.
FLOW
,
results
);
}
HashMap
<
Env
<
AttrContext
>,
Queue
<
Pair
<
Env
<
AttrContext
>,
JCClassDecl
>>>
desugaredEnvs
=
new
HashMap
<
Env
<
AttrContext
>,
Queue
<
Pair
<
Env
<
AttrContext
>,
JCClassDecl
>>>();
/**
* Prepare attributed parse trees, in conjunction with their attribution contexts,
* for source or code generation. If the file was not listed on the command line,
...
...
@@ -1222,10 +1225,17 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
return
;
}
if
(
compileStates
.
isDone
(
env
,
CompileState
.
LOWER
))
{
results
.
addAll
(
desugaredEnvs
.
get
(
env
));
return
;
}
/**
* As erasure (TransTypes) destroys information needed in flow analysis,
* including information in supertypes, we need to ensure that supertypes
* are processed through attribute and flow before subtypes are translated.
* Ensure that superclasses of C are desugared before C itself. This is
* required for two reasons: (i) as erasure (TransTypes) destroys
* information needed in flow analysis and (ii) as some checks carried
* out during lowering require that all synthetic fields/methods have
* already been added to C and its superclasses.
*/
class
ScanNested
extends
TreeScanner
{
Set
<
Env
<
AttrContext
>>
dependencies
=
new
LinkedHashSet
<
Env
<
AttrContext
>>();
...
...
@@ -1246,8 +1256,8 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
ScanNested
scanner
=
new
ScanNested
();
scanner
.
scan
(
env
.
tree
);
for
(
Env
<
AttrContext
>
dep:
scanner
.
dependencies
)
{
if
(!
compileStates
.
isDone
(
dep
,
CompileState
.
FLOW
))
flow
(
attribute
(
dep
));
if
(!
compileStates
.
isDone
(
dep
,
CompileState
.
FLOW
))
desugaredEnvs
.
put
(
dep
,
desugar
(
flow
(
attribute
(
dep
))
));
}
//We need to check for error another time as more classes might
...
...
@@ -1298,6 +1308,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
return
;
env
.
tree
=
transTypes
.
translateTopLevelClass
(
env
.
tree
,
localMake
);
compileStates
.
put
(
env
,
CompileState
.
TRANSTYPES
);
if
(
shouldStop
(
CompileState
.
LOWER
))
return
;
...
...
@@ -1315,6 +1326,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
//translate out inner classes
List
<
JCTree
>
cdefs
=
lower
.
translateTopLevelClass
(
env
,
env
.
tree
,
localMake
);
compileStates
.
put
(
env
,
CompileState
.
LOWER
);
if
(
shouldStop
(
CompileState
.
LOWER
))
return
;
...
...
src/share/classes/com/sun/tools/javac/resources/compiler.properties
浏览文件 @
ce6ac034
...
...
@@ -431,6 +431,8 @@ compiler.err.static.imp.only.classes.and.interfaces=\
static import only from classes and interfaces
compiler.err.synthetic.name.conflict
=
\
the symbol {0} conflicts with a compiler-synthesized symbol in {1}
compiler.warn.synthetic.name.conflict
=
\
the symbol {0} conflicts with a compiler-synthesized symbol in {1}
compiler.err.throws.not.allowed.in.intf.annotation
=
\
throws clause not allowed in @interface members
...
...
@@ -761,7 +763,7 @@ compiler.warn.unchecked.meth.invocation.applied=\
found: {3}
compiler.warn.unchecked.generic.array.creation
=
\
[unchecked] unchecked generic array creation
of type {0} for varargs parameter
[unchecked] unchecked generic array creation
for varargs parameter of type {0}
compiler.warn.missing.deprecated.annotation
=
\
[dep-ann] deprecated item is not annotated with @Deprecated
...
...
@@ -1091,23 +1093,33 @@ compiler.misc.no.args=\
no arguments
compiler.err.override.static
=
\
{0}; overriding method is static
{0}
\n\
overriding method is static
compiler.err.override.meth
=
\
{0}; overridden method is {1}
{0}
\n\
overridden method is {1}
compiler.err.override.meth.doesnt.throw
=
\
{0}; overridden method does not throw {1}
{0}
\n\
overridden method does not throw {1}
# In the following string {1} is a space separated list of Java Keywords, as
# they would have been declared in the source code
compiler.err.override.weaker.access
=
\
{0}; attempting to assign weaker access privileges; was {1}
{0}
\n\
attempting to assign weaker access privileges; was {1}
compiler.err.override.incompatible.ret
=
\
{0}
\n\
return type {1} is not compatible with {2}
compiler.misc.override.incompatible.ret
=
\
{0}; attempting to use incompatible return type
compiler.warn.override.unchecked.ret
=
\
[unchecked] {0}
\n\
return type requires unchecked conversion from {1} to {2}
compiler.misc.override.unchecked.ret
=
\
{0}; return type requires unchecked conversion
compiler.warn.override.unchecked.thrown
=
\
[unchecked] {0}
\n\
overridden method does not throw {1}
## The following are all possible strings for the first argument ({0}) of the
## above strings.
...
...
test/tools/javac/6390045/T6390045a.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6390045
* @summary Unexpected error "cannot access java.lang.Void" with '-target cldc1.0' with -source >=1.5
*
* @author mcimadamore
* @compile -XDfailcomplete=java.lang.Void T6390045a.java
*/
class
T6390045a
{
boolean
b
;
short
s
;
Object
o
;
Object
p
=
b
?
o
:
s
;
}
test/tools/javac/6390045/T6390045b.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6390045
* @summary Unexpected error "cannot access java.lang.Void" with '-target cldc1.0' with -source >=1.5
*
* @author mcimadamore
* @compile -XDfailcomplete=java.lang.Void T6390045b.java
*/
class
T6390045b
{
short
s
;
Object
o
;
Object
p
=
choose
(
o
,
s
);
<
T
>
T
choose
(
T
t1
,
T
t2
)
{
return
t1
;
}
}
test/tools/javac/6521805/T6521805a.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6521805
* @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
* @author mcimadamore
*
* @compile/fail/ref=T6521805a_1.out T6521805a.java -XDrawDiagnostics
* @compile/ref=T6521805a_2.out T6521805a.java -XDwarnOnSyntheticConflicts -XDrawDiagnostics
*/
class
T6521805a
{
static
class
Outer
{
T6521805a
this
$
0
=
null
;
}
public
class
Inner
extends
Outer
{
public
void
foo
()
{
this
$
0
=
new
T6521805a
();
}
}
}
test/tools/javac/6521805/T6521805a_1.out
0 → 100644
浏览文件 @
ce6ac034
T6521805a.java:40:12: compiler.err.synthetic.name.conflict: this$0, T6521805a.Outer
1 error
test/tools/javac/6521805/T6521805a_2.out
0 → 100644
浏览文件 @
ce6ac034
T6521805a.java:40:12: compiler.warn.synthetic.name.conflict: this$0, T6521805a.Outer
1 warning
test/tools/javac/6521805/T6521805b.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6521805
* @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
* @author mcimadamore
*
* @compile T6521805b.java
*/
class
T6521805b
{
static
class
Outer
{
String
this
$
0
=
null
;
}
public
class
Inner
extends
Outer
{
public
void
foo
()
{
this
$
0
=
"Hello!"
;
}
}
}
test/tools/javac/6521805/T6521805c.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6521805
* @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
* @author mcimadamore
*
* @compile T6521805c.java
*/
class
T6521805c
{
static
class
Outer
{
T6521805c
this
$
0
()
{
return
null
;}
}
public
class
Inner
extends
Outer
{
public
void
foo
()
{
this
$
0
();
}
}
}
test/tools/javac/6521805/T6521805d.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6521805
* @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
* @author mcimadamore
*
* @compile/fail/ref=T6521805d.out T6521805d.java -XDrawDiagnostics
*/
class
T6521805
{
static
class
Inner
extends
T6521805
.
Outer
{
Inner
(
T6521805
t
)
{
t
.
super
();
}
T6521805
this
$
0
=
null
;
public
void
foo
()
{
this
$
0
=
new
T6521805
();
}
}
class
Outer
{}
}
test/tools/javac/6521805/T6521805d.out
0 → 100644
浏览文件 @
ce6ac034
T6521805d.java:41:18: compiler.err.synthetic.name.conflict: this$0, T6521805.Inner
1 error
test/tools/javac/6521805/T6521805e.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6521805
* @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
* @author mcimadamore
*
* @compile/fail/ref=T6521805e.out p/Outer.java p/Sub.java -XDrawDiagnostics
* @compile/fail/ref=T6521805e.out p/Sub.java p/Outer.java -XDrawDiagnostics
*/
test/tools/javac/6521805/T6521805e.out
0 → 100644
浏览文件 @
ce6ac034
Sub.java:8:11: compiler.err.synthetic.name.conflict: this$0, p.Inner
1 error
test/tools/javac/6521805/p/Outer.java
0 → 100644
浏览文件 @
ce6ac034
package
p
;
class
Outer
{
class
Super
{}
}
test/tools/javac/6521805/p/Sub.java
0 → 100644
浏览文件 @
ce6ac034
package
p
;
class
Inner
extends
Outer
.
Super
{
Inner
(
Outer
t
)
{
t
.
super
();
}
Outer
this
$
0
=
null
;
public
void
foo
()
{
this
$
0
=
new
Outer
();
}
}
test/tools/javac/6734819/T6734819a.out
浏览文件 @
ce6ac034
...
...
@@ -4,9 +4,9 @@
[flow W]
[attribute Z]
[flow Z]
[desugar Z]
[desugar W]
[desugar Y]
[generate code Y]
[desugar W]
[generate code W]
[desugar Z]
[generate code Z]
test/tools/javac/6734819/T6734819b.out
浏览文件 @
ce6ac034
...
...
@@ -2,8 +2,8 @@
[flow A]
[attribute B]
[flow B]
[desugar B]
[desugar A]
[generate code A]
[desugar B]
[generate code B.C]
[generate code B]
test/tools/javac/6840059/T6840059.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6840059
* @summary 6758789: Some method resolution diagnostic should be improved
* @author Maurizio Cimadamore
*
* @compile/fail/ref=T6840059.out -XDrawDiagnostics T6840059.java
*/
class
T6840059
{
T6840059
(
Integer
x
)
{}
void
test
()
{
new
T6840059
(
""
){};
}
}
test/tools/javac/6840059/T6840059.out
0 → 100644
浏览文件 @
ce6ac034
T6840059.java:38:9: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , java.lang.String, kindname.class, T6840059
T6840059.java:38:25: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , , kindname.class, T6840059
2 errors
test/tools/javac/OverrideChecks/6199153/T6199153.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @bug 6199153
* @summary Generic throws and overriding
* @author mcimadamore
* @compile/fail/ref=T6199153.out -Xlint -Werror -XDrawDiagnostics T6199153.java
*/
import
java.io.IOException
;
class
T6199153
{
static
class
A
{
public
<
T
extends
IOException
>
void
m
()
throws
T
{}
}
static
class
B
extends
A
{
public
void
m
()
throws
IOException
{}
}
}
test/tools/javac/OverrideChecks/6199153/T6199153.out
0 → 100644
浏览文件 @
ce6ac034
T6199153.java:41:21: compiler.warn.override.unchecked.thrown: (compiler.misc.cant.override: m(), T6199153.B, <T>m(), T6199153.A), java.io.IOException
- compiler.err.warnings.and.werror
1 error
1 warning
test/tools/javac/generics/T6869075.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6869075
* @summary regression: javac crashes when compiling compound string assignment with generics
* @author mcimadamore
*/
public
class
T6869075
{
static
class
Foo
<
X
>
{
X
x
;
Foo
(
X
x
)
{
this
.
x
=
x
;
}
}
static
void
test1
(
Foo
<
String
>
foo
)
{
String
start
=
foo
.
x
;
equals
(
foo
.
x
+=
"foo"
,
start
+
"foo"
);
}
static
void
test2
(
Foo
<
String
>
foo
)
{
String
start
=
foo
.
x
;
equals
((
foo
.
x
+=
"foo"
),
(
start
+
"foo"
));
}
static
void
test3
(
Foo
<
String
>
foo
)
{
String
start
=
foo
.
x
;
equals
(((
foo
.
x
+=
"foo"
)),
((
start
+
"foo"
)));
}
public
static
void
main
(
String
[]
args
)
{
test1
(
new
Foo
<
String
>(
"Hello!"
));
test2
(
new
Foo
<
String
>(
"Hello!"
));
test3
(
new
Foo
<
String
>(
"Hello!"
));
}
static
void
equals
(
String
found
,
String
req
)
{
if
(!
found
.
equals
(
req
))
{
throw
new
AssertionError
(
"Error (expected: "
+
req
+
" - found: "
+
found
+
")"
);
}
}
}
\ No newline at end of file
test/tools/javac/generics/typevars/6569404/T6569404a.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6569404
* @summary Regression: Cannot instantiate an inner class of a type variable
* @author mcimadamore
*/
public
class
T6569404a
{
static
class
Outer
{
public
class
Inner
{}
}
static
class
Test
<
T
extends
Outer
>
{
public
Test
(
T
t
)
{
Outer
.
Inner
inner
=
t
.
new
Inner
();
}
}
public
static
void
main
(
String
[]
args
)
{
new
Test
<
Outer
>(
new
Outer
());
}
}
test/tools/javac/generics/typevars/6569404/T6569404b.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6569404
* @summary Regression: Cannot instantiate an inner class of a type variable
* @author mcimadamore
* @compile/fail/ref=T6569404b.out T6569404b.java -XDrawDiagnostics
*/
class
T6569404b
{
static
class
A
<
X
>
{}
static
class
B
<
T
extends
Outer
>
extends
A
<
T
.
Inner
>
{}
static
class
Outer
{
public
class
Inner
{}
}
}
test/tools/javac/generics/typevars/6569404/T6569404b.out
0 → 100644
浏览文件 @
ce6ac034
T6569404b.java:36:48: compiler.err.type.var.cant.be.deref
1 error
test/tools/javac/generics/typevars/6569404/T6569404c.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6569404
* @summary Regression: Cannot instantiate an inner class of a type variable
* @author mcimadamore
*/
public
class
T6569404c
{
static
class
Outer
{
class
Inner
{}
}
static
class
Test
<
X
extends
Outer
>
{
class
InnerTest
extends
X
.
Inner
{
InnerTest
(
Outer
o
)
{
o
.
super
();}
}
}
public
static
void
main
(
String
[]
args
)
{
new
Test
<
Outer
>().
new
InnerTest
(
new
Outer
());
}
}
test/tools/javac/policy/test2/byfile.AB.out
浏览文件 @
ce6ac034
...
...
@@ -2,6 +2,7 @@
[flow A]
[attribute B]
[flow B]
[desugar B]
[desugar A]
[generate code A.A1]
[generate code A.A2]
...
...
@@ -10,6 +11,5 @@
[generate code <anonymous A$A4$1>]
[generate code A.A4]
[generate code A]
[desugar B]
[generate code B.Inner]
[generate code B]
test/tools/javac/policy/test2/bytodo.AB.out
浏览文件 @
ce6ac034
...
...
@@ -2,6 +2,7 @@
[flow A]
[attribute B]
[flow B]
[desugar B]
[desugar A]
[generate code A.A1]
[generate code A.A2]
...
...
@@ -10,6 +11,5 @@
[generate code <anonymous A$A4$1>]
[generate code A.A4]
[generate code A]
[desugar B]
[generate code B.Inner]
[generate code B]
test/tools/javac/varargs/6806876/T6806876.java
0 → 100644
浏览文件 @
ce6ac034
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6806876
* @author mcimadamore
* @summary ClassCastException occurs in assignment expressions without any heap pollutions
* @compile/fail/ref=T6806876.out -Xlint:unchecked -Werror -XDrawDiagnostics T6806876.java
*/
class
T6806876
{
void
test
(
Integer
i
,
Long
l
)
{
Comparable
<?>[]
res
=
m
(
i
,
l
);
}
<
T
>
T
[]
m
(
T
...
a
)
{
return
null
;
}
}
\ No newline at end of file
test/tools/javac/varargs/6806876/T6806876.out
0 → 100644
浏览文件 @
ce6ac034
T6806876.java:34:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>>[]
- compiler.err.warnings.and.werror
1 error
1 warning
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录