Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
81924db8
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看板
提交
81924db8
编写于
8月 30, 2012
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
85d3d3ea
20582492
变更
49
隐藏空白更改
内联
并排
Showing
49 changed file
with
310 addition
and
81 deletion
+310
-81
make/jprt.properties
make/jprt.properties
+1
-1
make/tools/anttasks/CompilePropertiesTask.java
make/tools/anttasks/CompilePropertiesTask.java
+1
-1
make/tools/anttasks/GenStubsTask.java
make/tools/anttasks/GenStubsTask.java
+1
-1
make/tools/anttasks/SelectToolTask.java
make/tools/anttasks/SelectToolTask.java
+1
-1
make/tools/compileproperties/CompileProperties.java
make/tools/compileproperties/CompileProperties.java
+1
-1
make/tools/genstubs/GenStubs.java
make/tools/genstubs/GenStubs.java
+1
-1
src/share/classes/com/sun/tools/javac/code/Source.java
src/share/classes/com/sun/tools/javac/code/Source.java
+1
-1
src/share/classes/com/sun/tools/javac/code/Type.java
src/share/classes/com/sun/tools/javac/code/Type.java
+1
-1
src/share/classes/com/sun/tools/javac/code/Types.java
src/share/classes/com/sun/tools/javac/code/Types.java
+8
-1
src/share/classes/com/sun/tools/javac/comp/AttrContext.java
src/share/classes/com/sun/tools/javac/comp/AttrContext.java
+1
-1
src/share/classes/com/sun/tools/javac/comp/Lower.java
src/share/classes/com/sun/tools/javac/comp/Lower.java
+0
-1
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/file/ZipFileIndex.java
src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java
+1
-1
src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+28
-28
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+21
-4
src/share/classes/com/sun/tools/javac/main/Main.java
src/share/classes/com/sun/tools/javac/main/Main.java
+1
-1
src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
...ses/com/sun/tools/javac/util/RichDiagnosticFormatter.java
+1
-1
test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh
test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh
+1
-1
test/tools/javac/StringsInSwitch/7181320/BinOpInCaseLabel.java
...tools/javac/StringsInSwitch/7181320/BinOpInCaseLabel.java
+38
-0
test/tools/javac/StringsInSwitch/7181320/CastInCaseLabel.java
.../tools/javac/StringsInSwitch/7181320/CastInCaseLabel.java
+38
-0
test/tools/javac/StringsInSwitch/7181320/CondExprInCaseLabel.java
...ls/javac/StringsInSwitch/7181320/CondExprInCaseLabel.java
+39
-0
test/tools/javac/StringsInSwitch/7181320/CondExprInCaseLabel1.java
...s/javac/StringsInSwitch/7181320/CondExprInCaseLabel1.java
+39
-0
test/tools/javac/StringsInSwitch/7181320/CondExprInCaseLabel2.java
...s/javac/StringsInSwitch/7181320/CondExprInCaseLabel2.java
+39
-0
test/tools/javac/api/7086261/T7086261.java
test/tools/javac/api/7086261/T7086261.java
+1
-1
test/tools/javac/api/T6397104.java
test/tools/javac/api/T6397104.java
+1
-1
test/tools/javac/diags/CheckExamples.java
test/tools/javac/diags/CheckExamples.java
+1
-1
test/tools/javac/diags/MessageInfo.java
test/tools/javac/diags/MessageInfo.java
+1
-1
test/tools/javac/diags/RunExamples.java
test/tools/javac/diags/RunExamples.java
+1
-1
test/tools/javac/diags/examples/ApplicableMethodFound1.java
test/tools/javac/diags/examples/ApplicableMethodFound1.java
+1
-1
test/tools/javac/diags/examples/IllegalDot.java
test/tools/javac/diags/examples/IllegalDot.java
+1
-1
test/tools/javac/diags/examples/InconvertibleTypes.java
test/tools/javac/diags/examples/InconvertibleTypes.java
+1
-1
test/tools/javac/diags/examples/KindnameConstructor.java
test/tools/javac/diags/examples/KindnameConstructor.java
+1
-1
test/tools/javac/diags/examples/NotApplicableMethodFound.java
.../tools/javac/diags/examples/NotApplicableMethodFound.java
+1
-1
test/tools/javac/diags/examples/PossibleLossPrecision.java
test/tools/javac/diags/examples/PossibleLossPrecision.java
+1
-1
test/tools/javac/diags/examples/ResourceNotApplicableToType.java
...ols/javac/diags/examples/ResourceNotApplicableToType.java
+1
-1
test/tools/javac/diags/examples/VarargsArgumentMismatch.java
test/tools/javac/diags/examples/VarargsArgumentMismatch.java
+1
-1
test/tools/javac/diags/examples/VerboseResolveMulti1.java
test/tools/javac/diags/examples/VerboseResolveMulti1.java
+1
-1
test/tools/javac/diags/examples/WhereCaptured.java
test/tools/javac/diags/examples/WhereCaptured.java
+1
-1
test/tools/javac/diags/examples/WhereCaptured1.java
test/tools/javac/diags/examples/WhereCaptured1.java
+1
-1
test/tools/javac/diags/examples/WhereIntersection.java
test/tools/javac/diags/examples/WhereIntersection.java
+1
-1
test/tools/javac/diags/examples/WhereTypeVar.java
test/tools/javac/diags/examples/WhereTypeVar.java
+1
-1
test/tools/javac/generics/typevars/T7148242.java
test/tools/javac/generics/typevars/T7148242.java
+1
-1
test/tools/javac/newlines/Newlines.sh
test/tools/javac/newlines/Newlines.sh
+1
-1
test/tools/javac/parser/T4881269.java
test/tools/javac/parser/T4881269.java
+1
-1
test/tools/javac/processing/6348499/T6348499.java
test/tools/javac/processing/6348499/T6348499.java
+3
-2
test/tools/javac/processing/6414633/T6414633.java
test/tools/javac/processing/6414633/T6414633.java
+13
-4
test/tools/javac/processing/T6920317.java
test/tools/javac/processing/T6920317.java
+4
-2
test/tools/javac/processing/TestWarnErrorCount.java
test/tools/javac/processing/TestWarnErrorCount.java
+1
-1
test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java
...ssing/options/testPrintProcessorInfo/TestWithXstdout.java
+4
-3
未找到文件。
make/jprt.properties
浏览文件 @
81924db8
#
#
# Copyright (c) 2006, 201
0
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 201
2
, 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
...
...
make/tools/anttasks/CompilePropertiesTask.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2007, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
2
, 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
...
...
make/tools/anttasks/GenStubsTask.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009,
2012,
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
...
...
make/tools/anttasks/SelectToolTask.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2008, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 20
12
, 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
...
...
make/tools/compileproperties/CompileProperties.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2002, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
2
, 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
...
...
make/tools/genstubs/GenStubs.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2009, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 201
2
, 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
...
...
src/share/classes/com/sun/tools/javac/code/Source.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2002, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
2
, 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
...
...
src/share/classes/com/sun/tools/javac/code/Type.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
2
, 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
...
...
src/share/classes/com/sun/tools/javac/code/Types.java
浏览文件 @
81924db8
...
@@ -1589,9 +1589,16 @@ public class Types {
...
@@ -1589,9 +1589,16 @@ public class Types {
* type parameters in t are deleted.
* type parameters in t are deleted.
*/
*/
public
Type
erasure
(
Type
t
)
{
public
Type
erasure
(
Type
t
)
{
return
erasure
(
t
,
false
);
return
eras
eNotNeeded
(
t
)?
t
:
eras
ure
(
t
,
false
);
}
}
//where
//where
private
boolean
eraseNotNeeded
(
Type
t
)
{
// We don't want to erase primitive types and String type as that
// operation is idempotent. Also, erasing these could result in loss
// of information such as constant values attached to such types.
return
(
t
.
tag
<=
lastBaseTag
)
||
(
syms
.
stringType
.
tsym
==
t
.
tsym
);
}
private
Type
erasure
(
Type
t
,
boolean
recurse
)
{
private
Type
erasure
(
Type
t
,
boolean
recurse
)
{
if
(
t
.
tag
<=
lastBaseTag
)
if
(
t
.
tag
<=
lastBaseTag
)
return
t
;
/* fast special case */
return
t
;
/* fast special case */
...
...
src/share/classes/com/sun/tools/javac/comp/AttrContext.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 1999, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 20
12
, 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
...
...
src/share/classes/com/sun/tools/javac/comp/Lower.java
浏览文件 @
81924db8
...
@@ -3499,7 +3499,6 @@ public class Lower extends TreeTranslator {
...
@@ -3499,7 +3499,6 @@ public class Lower extends TreeTranslator {
JCExpression
expression
=
oneCase
.
getExpression
();
JCExpression
expression
=
oneCase
.
getExpression
();
if
(
expression
!=
null
)
{
// expression for a "default" case is null
if
(
expression
!=
null
)
{
// expression for a "default" case is null
expression
=
TreeInfo
.
skipParens
(
expression
);
String
labelExpr
=
(
String
)
expression
.
type
.
constValue
();
String
labelExpr
=
(
String
)
expression
.
type
.
constValue
();
Integer
mapping
=
caseLabelToPosition
.
put
(
labelExpr
,
casePosition
);
Integer
mapping
=
caseLabelToPosition
.
put
(
labelExpr
,
casePosition
);
Assert
.
checkNull
(
mapping
);
Assert
.
checkNull
(
mapping
);
...
...
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
2
, 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
...
...
src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2007, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
2
, 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
...
...
src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
浏览文件 @
81924db8
...
@@ -188,7 +188,7 @@ public class ClassReader implements Completer {
...
@@ -188,7 +188,7 @@ public class ClassReader implements Completer {
/** The current input pointer.
/** The current input pointer.
*/
*/
int
bp
;
protected
int
bp
;
/** The objects of the constant pool.
/** The objects of the constant pool.
*/
*/
...
@@ -890,13 +890,13 @@ public class ClassReader implements Completer {
...
@@ -890,13 +890,13 @@ public class ClassReader implements Completer {
protected
enum
AttributeKind
{
CLASS
,
MEMBER
};
protected
enum
AttributeKind
{
CLASS
,
MEMBER
};
protected
abstract
class
AttributeReader
{
protected
abstract
class
AttributeReader
{
AttributeReader
(
Name
name
,
ClassFile
.
Version
version
,
Set
<
AttributeKind
>
kinds
)
{
protected
AttributeReader
(
Name
name
,
ClassFile
.
Version
version
,
Set
<
AttributeKind
>
kinds
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
version
=
version
;
this
.
version
=
version
;
this
.
kinds
=
kinds
;
this
.
kinds
=
kinds
;
}
}
boolean
accepts
(
AttributeKind
kind
)
{
protected
boolean
accepts
(
AttributeKind
kind
)
{
if
(
kinds
.
contains
(
kind
))
{
if
(
kinds
.
contains
(
kind
))
{
if
(
majorVersion
>
version
.
major
||
(
majorVersion
==
version
.
major
&&
minorVersion
>=
version
.
minor
))
if
(
majorVersion
>
version
.
major
||
(
majorVersion
==
version
.
major
&&
minorVersion
>=
version
.
minor
))
return
true
;
return
true
;
...
@@ -915,11 +915,11 @@ public class ClassReader implements Completer {
...
@@ -915,11 +915,11 @@ public class ClassReader implements Completer {
return
false
;
return
false
;
}
}
abstract
void
read
(
Symbol
sym
,
int
attrLen
);
protected
abstract
void
read
(
Symbol
sym
,
int
attrLen
);
final
Name
name
;
protected
final
Name
name
;
final
ClassFile
.
Version
version
;
protected
final
ClassFile
.
Version
version
;
final
Set
<
AttributeKind
>
kinds
;
protected
final
Set
<
AttributeKind
>
kinds
;
}
}
protected
Set
<
AttributeKind
>
CLASS_ATTRIBUTE
=
protected
Set
<
AttributeKind
>
CLASS_ATTRIBUTE
=
...
@@ -936,7 +936,7 @@ public class ClassReader implements Completer {
...
@@ -936,7 +936,7 @@ public class ClassReader implements Completer {
// v45.3 attributes
// v45.3 attributes
new
AttributeReader
(
names
.
Code
,
V45_3
,
MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Code
,
V45_3
,
MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
if
(
readAllOfClassFile
||
saveParameterNames
)
if
(
readAllOfClassFile
||
saveParameterNames
)
((
MethodSymbol
)
sym
).
code
=
readCode
(
sym
);
((
MethodSymbol
)
sym
).
code
=
readCode
(
sym
);
else
else
...
@@ -945,7 +945,7 @@ public class ClassReader implements Completer {
...
@@ -945,7 +945,7 @@ public class ClassReader implements Completer {
},
},
new
AttributeReader
(
names
.
ConstantValue
,
V45_3
,
MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
ConstantValue
,
V45_3
,
MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
Object
v
=
readPool
(
nextChar
());
Object
v
=
readPool
(
nextChar
());
// Ignore ConstantValue attribute if field not final.
// Ignore ConstantValue attribute if field not final.
if
((
sym
.
flags
()
&
FINAL
)
!=
0
)
if
((
sym
.
flags
()
&
FINAL
)
!=
0
)
...
@@ -954,13 +954,13 @@ public class ClassReader implements Completer {
...
@@ -954,13 +954,13 @@ public class ClassReader implements Completer {
},
},
new
AttributeReader
(
names
.
Deprecated
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Deprecated
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
sym
.
flags_field
|=
DEPRECATED
;
sym
.
flags_field
|=
DEPRECATED
;
}
}
},
},
new
AttributeReader
(
names
.
Exceptions
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Exceptions
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
int
nexceptions
=
nextChar
();
int
nexceptions
=
nextChar
();
List
<
Type
>
thrown
=
List
.
nil
();
List
<
Type
>
thrown
=
List
.
nil
();
for
(
int
j
=
0
;
j
<
nexceptions
;
j
++)
for
(
int
j
=
0
;
j
<
nexceptions
;
j
++)
...
@@ -971,14 +971,14 @@ public class ClassReader implements Completer {
...
@@ -971,14 +971,14 @@ public class ClassReader implements Completer {
},
},
new
AttributeReader
(
names
.
InnerClasses
,
V45_3
,
CLASS_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
InnerClasses
,
V45_3
,
CLASS_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
ClassSymbol
c
=
(
ClassSymbol
)
sym
;
ClassSymbol
c
=
(
ClassSymbol
)
sym
;
readInnerClasses
(
c
);
readInnerClasses
(
c
);
}
}
},
},
new
AttributeReader
(
names
.
LocalVariableTable
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
LocalVariableTable
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
int
newbp
=
bp
+
attrLen
;
int
newbp
=
bp
+
attrLen
;
if
(
saveParameterNames
)
{
if
(
saveParameterNames
)
{
// Pick up parameter names from the variable table.
// Pick up parameter names from the variable table.
...
@@ -1014,7 +1014,7 @@ public class ClassReader implements Completer {
...
@@ -1014,7 +1014,7 @@ public class ClassReader implements Completer {
},
},
new
AttributeReader
(
names
.
SourceFile
,
V45_3
,
CLASS_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
SourceFile
,
V45_3
,
CLASS_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
ClassSymbol
c
=
(
ClassSymbol
)
sym
;
ClassSymbol
c
=
(
ClassSymbol
)
sym
;
Name
n
=
readName
(
nextChar
());
Name
n
=
readName
(
nextChar
());
c
.
sourcefile
=
new
SourceFileObject
(
n
,
c
.
flatname
);
c
.
sourcefile
=
new
SourceFileObject
(
n
,
c
.
flatname
);
...
@@ -1022,7 +1022,7 @@ public class ClassReader implements Completer {
...
@@ -1022,7 +1022,7 @@ public class ClassReader implements Completer {
},
},
new
AttributeReader
(
names
.
Synthetic
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Synthetic
,
V45_3
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
// bridge methods are visible when generics not enabled
// bridge methods are visible when generics not enabled
if
(
allowGenerics
||
(
sym
.
flags_field
&
BRIDGE
)
==
0
)
if
(
allowGenerics
||
(
sym
.
flags_field
&
BRIDGE
)
==
0
)
sym
.
flags_field
|=
SYNTHETIC
;
sym
.
flags_field
|=
SYNTHETIC
;
...
@@ -1032,7 +1032,7 @@ public class ClassReader implements Completer {
...
@@ -1032,7 +1032,7 @@ public class ClassReader implements Completer {
// standard v49 attributes
// standard v49 attributes
new
AttributeReader
(
names
.
EnclosingMethod
,
V49
,
CLASS_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
EnclosingMethod
,
V49
,
CLASS_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
int
newbp
=
bp
+
attrLen
;
int
newbp
=
bp
+
attrLen
;
readEnclosingMethodAttr
(
sym
);
readEnclosingMethodAttr
(
sym
);
bp
=
newbp
;
bp
=
newbp
;
...
@@ -1041,11 +1041,11 @@ public class ClassReader implements Completer {
...
@@ -1041,11 +1041,11 @@ public class ClassReader implements Completer {
new
AttributeReader
(
names
.
Signature
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Signature
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
@Override
@Override
boolean
accepts
(
AttributeKind
kind
)
{
protected
boolean
accepts
(
AttributeKind
kind
)
{
return
super
.
accepts
(
kind
)
&&
allowGenerics
;
return
super
.
accepts
(
kind
)
&&
allowGenerics
;
}
}
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
if
(
sym
.
kind
==
TYP
)
{
if
(
sym
.
kind
==
TYP
)
{
ClassSymbol
c
=
(
ClassSymbol
)
sym
;
ClassSymbol
c
=
(
ClassSymbol
)
sym
;
readingClassAttr
=
true
;
readingClassAttr
=
true
;
...
@@ -1074,31 +1074,31 @@ public class ClassReader implements Completer {
...
@@ -1074,31 +1074,31 @@ public class ClassReader implements Completer {
// v49 annotation attributes
// v49 annotation attributes
new
AttributeReader
(
names
.
AnnotationDefault
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
AnnotationDefault
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
attachAnnotationDefault
(
sym
);
attachAnnotationDefault
(
sym
);
}
}
},
},
new
AttributeReader
(
names
.
RuntimeInvisibleAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
RuntimeInvisibleAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
attachAnnotations
(
sym
);
attachAnnotations
(
sym
);
}
}
},
},
new
AttributeReader
(
names
.
RuntimeInvisibleParameterAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
RuntimeInvisibleParameterAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
attachParameterAnnotations
(
sym
);
attachParameterAnnotations
(
sym
);
}
}
},
},
new
AttributeReader
(
names
.
RuntimeVisibleAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
RuntimeVisibleAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
attachAnnotations
(
sym
);
attachAnnotations
(
sym
);
}
}
},
},
new
AttributeReader
(
names
.
RuntimeVisibleParameterAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
RuntimeVisibleParameterAnnotations
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
attachParameterAnnotations
(
sym
);
attachParameterAnnotations
(
sym
);
}
}
},
},
...
@@ -1106,14 +1106,14 @@ public class ClassReader implements Completer {
...
@@ -1106,14 +1106,14 @@ public class ClassReader implements Completer {
// additional "legacy" v49 attributes, superceded by flags
// additional "legacy" v49 attributes, superceded by flags
new
AttributeReader
(
names
.
Annotation
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Annotation
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
if
(
allowAnnotations
)
if
(
allowAnnotations
)
sym
.
flags_field
|=
ANNOTATION
;
sym
.
flags_field
|=
ANNOTATION
;
}
}
},
},
new
AttributeReader
(
names
.
Bridge
,
V49
,
MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Bridge
,
V49
,
MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
sym
.
flags_field
|=
BRIDGE
;
sym
.
flags_field
|=
BRIDGE
;
if
(!
allowGenerics
)
if
(!
allowGenerics
)
sym
.
flags_field
&=
~
SYNTHETIC
;
sym
.
flags_field
&=
~
SYNTHETIC
;
...
@@ -1121,13 +1121,13 @@ public class ClassReader implements Completer {
...
@@ -1121,13 +1121,13 @@ public class ClassReader implements Completer {
},
},
new
AttributeReader
(
names
.
Enum
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Enum
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
sym
.
flags_field
|=
ENUM
;
sym
.
flags_field
|=
ENUM
;
}
}
},
},
new
AttributeReader
(
names
.
Varargs
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
new
AttributeReader
(
names
.
Varargs
,
V49
,
CLASS_OR_MEMBER_ATTRIBUTE
)
{
void
read
(
Symbol
sym
,
int
attrLen
)
{
protected
void
read
(
Symbol
sym
,
int
attrLen
)
{
if
(
allowVarargs
)
if
(
allowVarargs
)
sym
.
flags_field
|=
VARARGS
;
sym
.
flags_field
|=
VARARGS
;
}
}
...
@@ -1153,7 +1153,7 @@ public class ClassReader implements Completer {
...
@@ -1153,7 +1153,7 @@ public class ClassReader implements Completer {
void
readEnclosingMethodAttr
(
Symbol
sym
)
{
protected
void
readEnclosingMethodAttr
(
Symbol
sym
)
{
// sym is a nested class with an "Enclosing Method" attribute
// sym is a nested class with an "Enclosing Method" attribute
// remove sym from it's current owners scope and place it in
// remove sym from it's current owners scope and place it in
// the scope specified by the attribute
// the scope specified by the attribute
...
...
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
浏览文件 @
81924db8
...
@@ -164,7 +164,7 @@ public class ClassWriter extends ClassFile {
...
@@ -164,7 +164,7 @@ public class ClassWriter extends ClassFile {
/** Construct a class writer, given an options table.
/** Construct a class writer, given an options table.
*/
*/
pr
ivate
ClassWriter
(
Context
context
)
{
pr
otected
ClassWriter
(
Context
context
)
{
context
.
put
(
classWriterKey
,
this
);
context
.
put
(
classWriterKey
,
this
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
...
@@ -601,12 +601,20 @@ public class ClassWriter extends ClassFile {
...
@@ -601,12 +601,20 @@ public class ClassWriter extends ClassFile {
* Returns the number of attributes written (0 or 1).
* Returns the number of attributes written (0 or 1).
*/
*/
int
writeEnclosingMethodAttribute
(
ClassSymbol
c
)
{
int
writeEnclosingMethodAttribute
(
ClassSymbol
c
)
{
if
(!
target
.
hasEnclosingMethodAttribute
()
||
if
(!
target
.
hasEnclosingMethodAttribute
())
c
.
owner
.
kind
!=
MTH
&&
// neither a local class
return
0
;
return
writeEnclosingMethodAttribute
(
names
.
EnclosingMethod
,
c
);
}
/** Write the EnclosingMethod attribute with a specified name.
* Returns the number of attributes written (0 or 1).
*/
protected
int
writeEnclosingMethodAttribute
(
Name
attributeName
,
ClassSymbol
c
)
{
if
(
c
.
owner
.
kind
!=
MTH
&&
// neither a local class
c
.
name
!=
names
.
empty
)
// nor anonymous
c
.
name
!=
names
.
empty
)
// nor anonymous
return
0
;
return
0
;
int
alenIdx
=
writeAttr
(
names
.
EnclosingMethod
);
int
alenIdx
=
writeAttr
(
attributeName
);
ClassSymbol
enclClass
=
c
.
owner
.
enclClass
();
ClassSymbol
enclClass
=
c
.
owner
.
enclClass
();
MethodSymbol
enclMethod
=
MethodSymbol
enclMethod
=
(
c
.
owner
.
type
==
null
// local to init block
(
c
.
owner
.
type
==
null
// local to init block
...
@@ -1569,6 +1577,7 @@ public class ClassWriter extends ClassFile {
...
@@ -1569,6 +1577,7 @@ public class ClassWriter extends ClassFile {
acount
+=
writeFlagAttrs
(
c
.
flags
());
acount
+=
writeFlagAttrs
(
c
.
flags
());
acount
+=
writeJavaAnnotations
(
c
.
getAnnotationMirrors
());
acount
+=
writeJavaAnnotations
(
c
.
getAnnotationMirrors
());
acount
+=
writeEnclosingMethodAttribute
(
c
);
acount
+=
writeEnclosingMethodAttribute
(
c
);
acount
+=
writeExtraClassAttributes
(
c
);
poolbuf
.
appendInt
(
JAVA_MAGIC
);
poolbuf
.
appendInt
(
JAVA_MAGIC
);
poolbuf
.
appendChar
(
target
.
minorVersion
);
poolbuf
.
appendChar
(
target
.
minorVersion
);
...
@@ -1588,6 +1597,14 @@ public class ClassWriter extends ClassFile {
...
@@ -1588,6 +1597,14 @@ public class ClassWriter extends ClassFile {
pool
=
c
.
pool
=
null
;
// to conserve space
pool
=
c
.
pool
=
null
;
// to conserve space
}
}
/**Allows subclasses to write additional class attributes
*
* @return the number of attributes written
*/
protected
int
writeExtraClassAttributes
(
ClassSymbol
c
)
{
return
0
;
}
int
adjustFlags
(
final
long
flags
)
{
int
adjustFlags
(
final
long
flags
)
{
int
result
=
(
int
)
flags
;
int
result
=
(
int
)
flags
;
if
((
flags
&
SYNTHETIC
)
!=
0
&&
!
target
.
useSyntheticFlag
())
if
((
flags
&
SYNTHETIC
)
!=
0
&&
!
target
.
useSyntheticFlag
())
...
...
src/share/classes/com/sun/tools/javac/main/Main.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
2
, 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
...
...
src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009,
2012,
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
...
...
test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh
浏览文件 @
81924db8
#
#
# Copyright (c) 1998, 20
09
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1998, 20
12
, 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
...
...
test/tools/javac/StringsInSwitch/7181320/BinOpInCaseLabel.java
0 → 100644
浏览文件 @
81924db8
/*
* Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7181320
* @summary javac NullPointerException for switch labels with cast to String expressions
* @compile BinOpInCaseLabel.java
*/
public
class
BinOpInCaseLabel
{
public
static
void
main
(
String
[]
args
)
{
switch
(
args
[
0
])
{
case
"hello"
+
"world"
:
break
;
}
}
}
test/tools/javac/StringsInSwitch/7181320/CastInCaseLabel.java
0 → 100644
浏览文件 @
81924db8
/*
* Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7181320
* @summary javac NullPointerException for switch labels with cast to String expressions
* @compile CastInCaseLabel.java
*/
public
class
CastInCaseLabel
{
public
static
void
main
(
String
[]
args
)
{
switch
(
args
[
0
])
{
case
(
String
)
"hello"
:
break
;
}
}
}
test/tools/javac/StringsInSwitch/7181320/CondExprInCaseLabel.java
0 → 100644
浏览文件 @
81924db8
/*
* Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7181320
* @summary javac NullPointerException for switch labels with cast to String expressions
* @compile CondExprInCaseLabel.java
*/
public
class
CondExprInCaseLabel
{
public
static
void
main
(
String
[]
args
)
{
final
boolean
cond
=
true
;
switch
(
args
[
0
])
{
case
cond
?
"hello"
:
"world"
:
break
;
}
}
}
test/tools/javac/StringsInSwitch/7181320/CondExprInCaseLabel1.java
0 → 100644
浏览文件 @
81924db8
/*
* Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7181320
* @summary javac NullPointerException for switch labels with cast to String expressions
* @compile CondExprInCaseLabel1.java
*/
public
class
CondExprInCaseLabel1
{
public
static
void
main
(
String
[]
args
)
{
final
boolean
cond
=
true
;
switch
(
args
[
0
])
{
case
cond
?
(
String
)
"hello"
:
"world"
:
break
;
}
}
}
test/tools/javac/StringsInSwitch/7181320/CondExprInCaseLabel2.java
0 → 100644
浏览文件 @
81924db8
/*
* Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7181320
* @summary javac NullPointerException for switch labels with cast to String expressions
* @compile CondExprInCaseLabel2.java
*/
public
class
CondExprInCaseLabel2
{
public
static
void
main
(
String
[]
args
)
{
final
boolean
cond
=
true
;
switch
(
args
[
0
])
{
case
cond
?
"hello"
:
(
String
)
"world"
:
break
;
}
}
}
test/tools/javac/api/7086261/T7086261.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
...
test/tools/javac/api/T6397104.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006,
2012,
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
...
...
test/tools/javac/diags/CheckExamples.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/MessageInfo.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 201
2
, 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
...
...
test/tools/javac/diags/RunExamples.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 201
2
, 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
...
...
test/tools/javac/diags/examples/ApplicableMethodFound1.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
...
test/tools/javac/diags/examples/IllegalDot.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
...
test/tools/javac/diags/examples/InconvertibleTypes.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/examples/KindnameConstructor.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 201
2
, 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
...
...
test/tools/javac/diags/examples/NotApplicableMethodFound.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
...
test/tools/javac/diags/examples/PossibleLossPrecision.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/examples/ResourceNotApplicableToType.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/examples/VarargsArgumentMismatch.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/examples/VerboseResolveMulti1.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
...
test/tools/javac/diags/examples/WhereCaptured.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/examples/WhereCaptured1.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/examples/WhereIntersection.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/diags/examples/WhereTypeVar.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
...
test/tools/javac/generics/typevars/T7148242.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2009, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 201
2
, 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
...
...
test/tools/javac/newlines/Newlines.sh
浏览文件 @
81924db8
#
#
# Copyright (c) 2002, 20
09
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 20
12
, 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
...
...
test/tools/javac/parser/T4881269.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
...
test/tools/javac/processing/6348499/T6348499.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2006, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 201
2
, 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
...
@@ -47,6 +47,7 @@ public class T6348499 {
...
@@ -47,6 +47,7 @@ public class T6348499 {
public
static
void
main
(
String
...
args
)
{
public
static
void
main
(
String
...
args
)
{
String
testSrc
=
System
.
getProperty
(
"test.src"
,
"."
);
String
testSrc
=
System
.
getProperty
(
"test.src"
,
"."
);
String
testClasses
=
System
.
getProperty
(
"test.classes"
);
String
testClasses
=
System
.
getProperty
(
"test.classes"
);
String
testClassPath
=
System
.
getProperty
(
"test.class.path"
,
testClasses
);
String
A_java
=
new
File
(
testSrc
,
"A.java"
).
getPath
();
String
A_java
=
new
File
(
testSrc
,
"A.java"
).
getPath
();
JavacTool
tool
=
JavacTool
.
create
();
JavacTool
tool
=
JavacTool
.
create
();
MyDiagListener
dl
=
new
MyDiagListener
();
MyDiagListener
dl
=
new
MyDiagListener
();
...
@@ -55,7 +56,7 @@ public class T6348499 {
...
@@ -55,7 +56,7 @@ public class T6348499 {
fm
.
getJavaFileObjectsFromFiles
(
Arrays
.
asList
(
new
File
(
testSrc
,
"A.java"
)));
fm
.
getJavaFileObjectsFromFiles
(
Arrays
.
asList
(
new
File
(
testSrc
,
"A.java"
)));
Iterable
<
String
>
opts
=
Arrays
.
asList
(
"-proc:only"
,
Iterable
<
String
>
opts
=
Arrays
.
asList
(
"-proc:only"
,
"-processor"
,
"A"
,
"-processor"
,
"A"
,
"-processorpath"
,
testClass
es
);
"-processorpath"
,
testClass
Path
);
StringWriter
out
=
new
StringWriter
();
StringWriter
out
=
new
StringWriter
();
JavacTask
task
=
tool
.
getTask
(
out
,
fm
,
dl
,
opts
,
null
,
files
);
JavacTask
task
=
tool
.
getTask
(
out
,
fm
,
dl
,
opts
,
null
,
files
);
task
.
call
();
task
.
call
();
...
...
test/tools/javac/processing/6414633/T6414633.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2006, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 201
2
, 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
...
@@ -43,20 +43,20 @@ public class T6414633 {
...
@@ -43,20 +43,20 @@ public class T6414633 {
public
static
void
main
(
String
...
args
)
{
public
static
void
main
(
String
...
args
)
{
String
testSrc
=
System
.
getProperty
(
"test.src"
,
"."
);
String
testSrc
=
System
.
getProperty
(
"test.src"
,
"."
);
String
testClasses
=
System
.
getProperty
(
"test.classes"
,
"."
);
String
testClasses
=
System
.
getProperty
(
"test.classes"
,
"."
);
String
testClassPath
=
System
.
getProperty
(
"test.class.path"
,
testClasses
);
JavacTool
tool
=
JavacTool
.
create
();
JavacTool
tool
=
JavacTool
.
create
();
MyDiagListener
dl
=
new
MyDiagListener
();
MyDiagListener
dl
=
new
MyDiagListener
();
StandardJavaFileManager
fm
=
tool
.
getStandardFileManager
(
dl
,
null
,
null
);
StandardJavaFileManager
fm
=
tool
.
getStandardFileManager
(
dl
,
null
,
null
);
try
{
try
{
fm
.
setLocation
(
StandardLocation
.
CLASS_PATH
,
Arrays
.
asList
(
new
File
(
testClasses
)
));
fm
.
setLocation
(
StandardLocation
.
CLASS_PATH
,
pathToFiles
(
testClassPath
));
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
AssertionError
(
e
);
throw
new
AssertionError
(
e
);
}
}
Iterable
<?
extends
JavaFileObject
>
files
=
Iterable
<?
extends
JavaFileObject
>
files
=
fm
.
getJavaFileObjectsFromFiles
(
Arrays
.
asList
(
new
File
(
testSrc
,
A
.
class
.
getName
()+
".java"
)));
fm
.
getJavaFileObjectsFromFiles
(
Arrays
.
asList
(
new
File
(
testSrc
,
A
.
class
.
getName
()+
".java"
)));
String
[]
opts
=
{
"-proc:only"
,
String
[]
opts
=
{
"-proc:only"
,
"-processor"
,
A
.
class
.
getName
(),
"-processor"
,
A
.
class
.
getName
()
};
"-classpath"
,
testClasses
+
System
.
getProperty
(
"path.separator"
)
+
"../../lib"
};
JavacTask
task
=
tool
.
getTask
(
null
,
fm
,
dl
,
Arrays
.
asList
(
opts
),
null
,
files
);
JavacTask
task
=
tool
.
getTask
(
null
,
fm
,
dl
,
Arrays
.
asList
(
opts
),
null
,
files
);
task
.
call
();
task
.
call
();
...
@@ -65,6 +65,15 @@ public class T6414633 {
...
@@ -65,6 +65,15 @@ public class T6414633 {
throw
new
AssertionError
(
dl
.
diags
+
" diagnostics reported"
);
throw
new
AssertionError
(
dl
.
diags
+
" diagnostics reported"
);
}
}
private
static
List
<
File
>
pathToFiles
(
String
path
)
{
List
<
File
>
list
=
new
ArrayList
<
File
>();
for
(
String
s:
path
.
split
(
File
.
pathSeparator
))
{
if
(!
s
.
isEmpty
())
list
.
add
(
new
File
(
s
));
}
return
list
;
}
private
static
class
MyDiagListener
implements
DiagnosticListener
<
JavaFileObject
>
private
static
class
MyDiagListener
implements
DiagnosticListener
<
JavaFileObject
>
{
{
public
void
report
(
Diagnostic
d
)
{
public
void
report
(
Diagnostic
d
)
{
...
...
test/tools/javac/processing/T6920317.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
2012,
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
...
@@ -156,7 +156,9 @@ public class T6920317 {
...
@@ -156,7 +156,9 @@ public class T6920317 {
String
expect
=
null
;
String
expect
=
null
;
opts
.
add
(
"-processorpath"
);
opts
.
add
(
"-processorpath"
);
opts
.
add
(
System
.
getProperty
(
"test.classes"
));
String
testClasses
=
System
.
getProperty
(
"test.classes"
);
String
testClassPath
=
System
.
getProperty
(
"test.class.path"
,
testClasses
);
opts
.
add
(
testClassPath
);
opts
.
add
(
"-processor"
);
opts
.
add
(
"-processor"
);
opts
.
add
(
Processor
.
class
.
getName
());
opts
.
add
(
Processor
.
class
.
getName
());
opts
.
add
(
"-proc:only"
);
opts
.
add
(
"-proc:only"
);
...
...
test/tools/javac/processing/TestWarnErrorCount.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
...
test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java
浏览文件 @
81924db8
/*
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
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
...
@@ -38,7 +38,8 @@ import java.util.*;
...
@@ -38,7 +38,8 @@ import java.util.*;
public
class
TestWithXstdout
{
public
class
TestWithXstdout
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
File
testSrc
=
new
File
(
System
.
getProperty
(
"test.src"
));
File
testSrc
=
new
File
(
System
.
getProperty
(
"test.src"
));
File
testClasses
=
new
File
(
System
.
getProperty
(
"test.classes"
));
String
testClasses
=
System
.
getProperty
(
"test.classes"
,
"."
);
String
testClassPath
=
System
.
getProperty
(
"test.class.path"
,
testClasses
);
File
stdout
=
new
File
(
"stdout.out"
);
File
stdout
=
new
File
(
"stdout.out"
);
run_javac
(
"-XDrawDiagnostics"
,
run_javac
(
"-XDrawDiagnostics"
,
"-XprintProcessorInfo"
,
"-XprintProcessorInfo"
,
...
@@ -46,7 +47,7 @@ public class TestWithXstdout {
...
@@ -46,7 +47,7 @@ public class TestWithXstdout {
"-proc:only"
,
"-proc:only"
,
"-processor"
,
"Test"
,
"-processor"
,
"Test"
,
"-Xstdout"
,
stdout
.
getPath
(),
"-Xstdout"
,
stdout
.
getPath
(),
"-classpath"
,
testClass
es
.
getPath
()
,
"-classpath"
,
testClass
Path
,
new
File
(
testSrc
,
"Test.java"
).
getPath
());
new
File
(
testSrc
,
"Test.java"
).
getPath
());
boolean
ok
=
compare
(
stdout
,
new
File
(
testSrc
,
"Test.out"
));
boolean
ok
=
compare
(
stdout
,
new
File
(
testSrc
,
"Test.out"
));
if
(!
ok
)
if
(!
ok
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录