Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
f4fd9a1e
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看板
提交
f4fd9a1e
编写于
8月 27, 2009
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6843707: bad tests generate files in the test/ directory
6876699: generated files in repository Reviewed-by: darcy
上级
ef999fc9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
2 addition
and
548 deletion
+2
-548
test/tools/javac/meth/InvokeMH_BAD68.java
test/tools/javac/meth/InvokeMH_BAD68.java
+0
-75
test/tools/javac/meth/InvokeMH_BAD72.java
test/tools/javac/meth/InvokeMH_BAD72.java
+0
-75
test/tools/javac/meth/MakeNegTests.sh
test/tools/javac/meth/MakeNegTests.sh
+1
-1
test/tools/javac/quid/MakeNegTests.sh
test/tools/javac/quid/MakeNegTests.sh
+1
-1
test/tools/javac/quid/QuotedIdent_BAD61.java
test/tools/javac/quid/QuotedIdent_BAD61.java
+0
-132
test/tools/javac/quid/QuotedIdent_BAD62.java
test/tools/javac/quid/QuotedIdent_BAD62.java
+0
-132
test/tools/javac/quid/QuotedIdent_BAD63.java
test/tools/javac/quid/QuotedIdent_BAD63.java
+0
-132
未找到文件。
test/tools/javac/meth/InvokeMH_BAD68.java
已删除
100644 → 0
浏览文件 @
ef999fc9
/*
* Copyright 2008 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 6754038
* ##summary Generate call sites for method handle
* ##author jrose
*
* ##compile/fail -source 7 -target 7 InvokeMH_BAD68.java
*/
/*
* Standalone testing:
* <code>
* $ cd $MY_REPO_DIR/langtools
* $ (cd make; make)
* $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/meth/InvokeMH_BAD68.java
* $ javap -c -classpath dist meth.InvokeMH_BAD68
* </code>
*/
package
meth
;
import
java.dyn.MethodHandle
;
public
class
InvokeMH_BAD68
{
void
test
(
MethodHandle
mh_SiO
,
MethodHandle
mh_vS
,
MethodHandle
mh_vi
,
MethodHandle
mh_vv
)
{
Object
o
;
String
s
;
int
i
;
// for return type testing
// next five must have sig = (String,int)Object
mh_SiO
.
invoke
(
"world"
,
123
);
mh_SiO
.
invoke
(
"mundus"
,
456
);
Object
k
=
"kosmos"
;
mh_SiO
.
invoke
((
String
)
k
,
789
);
o
=
mh_SiO
.
invoke
((
String
)
null
,
000
);
o
=
mh_SiO
.<
Object
>
invoke
(
"arda"
,
-
123
);
// sig = ()String
s
=
mh_vS
.<
String
>
invoke
();
// sig = ()int
i
=
mh_vi
.<
int
>
invoke
();
o
=
mh_vi
.<
int
>
invoke
();
s
=
mh_vi
.<
int
>
invoke
();
//BAD
mh_vi
.<
int
>
invoke
();
// sig = ()void
//o = mh_vv.<void>invoke(); //BAD
mh_vv
.<
void
>
invoke
();
}
}
test/tools/javac/meth/InvokeMH_BAD72.java
已删除
100644 → 0
浏览文件 @
ef999fc9
/*
* Copyright 2008 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 6754038
* ##summary Generate call sites for method handle
* ##author jrose
*
* ##compile/fail -source 7 -target 7 InvokeMH_BAD72.java
*/
/*
* Standalone testing:
* <code>
* $ cd $MY_REPO_DIR/langtools
* $ (cd make; make)
* $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/meth/InvokeMH_BAD72.java
* $ javap -c -classpath dist meth.InvokeMH_BAD72
* </code>
*/
package
meth
;
import
java.dyn.MethodHandle
;
public
class
InvokeMH_BAD72
{
void
test
(
MethodHandle
mh_SiO
,
MethodHandle
mh_vS
,
MethodHandle
mh_vi
,
MethodHandle
mh_vv
)
{
Object
o
;
String
s
;
int
i
;
// for return type testing
// next five must have sig = (String,int)Object
mh_SiO
.
invoke
(
"world"
,
123
);
mh_SiO
.
invoke
(
"mundus"
,
456
);
Object
k
=
"kosmos"
;
mh_SiO
.
invoke
((
String
)
k
,
789
);
o
=
mh_SiO
.
invoke
((
String
)
null
,
000
);
o
=
mh_SiO
.<
Object
>
invoke
(
"arda"
,
-
123
);
// sig = ()String
s
=
mh_vS
.<
String
>
invoke
();
// sig = ()int
i
=
mh_vi
.<
int
>
invoke
();
o
=
mh_vi
.<
int
>
invoke
();
//s = mh_vi.<int>invoke(); //BAD
mh_vi
.<
int
>
invoke
();
// sig = ()void
o
=
mh_vv
.<
void
>
invoke
();
//BAD
mh_vv
.<
void
>
invoke
();
}
}
test/tools/javac/meth/MakeNegTests.sh
浏览文件 @
f4fd9a1e
...
...
@@ -78,7 +78,7 @@ expand() {
}
getcasestem
()
{
echo
"
$1
"
|
sed
's/\.java$//;s/_BAD[0-9]*$//;s/$/_BAD/'
echo
`
basename
$1
`
|
sed
's/\.java$//;s/_BAD[0-9]*$//;s/$/_BAD/'
}
testneg
()
{
...
...
test/tools/javac/quid/MakeNegTests.sh
浏览文件 @
f4fd9a1e
...
...
@@ -77,7 +77,7 @@ expand() {
}
getcasestem
()
{
echo
"
$1
"
|
sed
'
s/\.java$//;s/_BAD[0-9]*$//;s/$/_BAD/'
echo
`
basename
$1
`
|
sed
's/.*\///;
s/\.java$//;s/_BAD[0-9]*$//;s/$/_BAD/'
}
testneg
()
{
...
...
test/tools/javac/quid/QuotedIdent_BAD61.java
已删除
100644 → 0
浏览文件 @
ef999fc9
/*
* Copyright 2008 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 6746458
* ##summary Verify correct lexing of quoted identifiers.
* ##author jrose
*
* ##library ..
* ##run main quid.QuotedIdent_BAD61
*/
/*
* Standalone testing:
* <code>
* $ cd $MY_REPO_DIR/langtools
* $ (cd make; make)
* $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent_BAD61.java
* $ java -version # should print 1.6 or later
* $ java -cp dist quid.QuotedIdent_BAD61
* </code>
*/
package
quid
;
public
class
QuotedIdent_BAD61
{
static
void
check
(
int
testid
,
String
have
,
String
expect
)
throws
RuntimeException
{
if
((
have
==
null
&&
have
!=
expect
)
||
(
have
!=
null
&&
!
have
.
equals
(
expect
)))
{
String
msg
=
"TEST "
+
testid
+
": HAVE \""
+
have
+
"\" EXPECT \""
+
expect
+
"\""
;
System
.
out
.
println
(
"StringConversion: "
+
msg
);
throw
new
RuntimeException
(
msg
);
}
}
// negative tests:
static
class
#""
{
}
//
BAD
empty
ident
name
//static class #"<foo>" { } //BAD bad char in ident name
/*static class /*(//BAD ident name interrupted by newline) #"jump:
" { } /* uncomment previous line to attempt class w/ bad name */
static
class
#"
int
" extends Number {
final int #"
int
";
#"
int
"(int #"
int
") {
this.#"
int
" = #"
int
";
}
static #"
int
" valueOf(int #"
int
") {
return new #"
int
"(#"
int
");
}
public int intValue() { return #"
int
"; }
public long longValue() { return #"
int
"; }
public float floatValue() { return #"
int
"; }
public double doubleValue() { return #"
int
"; }
public String toString() { return String.valueOf(#"
int
"); }
}
class #"
*
86
" {
String #"
555
-
1212
"() { return "
[*
86.555
-
1212
]
"; }
}
static#"
*
86
"#"
MAKE
-*
86
"() { // note close spacing
return new QuotedIdent_BAD61().new#"
*
86
"();
}
static String bar() { return "
[
bar
]
"; }
public static void main(String[] args) throws Exception {
String s;
String #"
sticky
\'
wicket
" = "
wicked
'
stick
";
s = #"
sticky
'
wicket
";
check(11, s, "
wicked
\'
stick
");
check(12, #"
s
", s);
check(13, #"
\
163
", s);
s = #"
QuotedIdent_BAD61
".bar();
check(21, s, "
[
bar
]
");
s = #"
int
".valueOf(123).toString();
check(22, s, "
123
");
s = #"
MAKE
-*
86
"().#"
555
-
1212
"();
check(23, s, "
[*
86.555
-
1212
]
");
class#"
{{{
inmost
}}}
" { }
s = new#"
{{{
inmost
}}}
"().getClass().getName();
if (!s.endsWith("
{{{
inmost
}}}
"))
check(24, s, "
should
end
with
\
"{{{inmost}}}\""
);
s
=
#
"Yog-Shoggoth"
.
#
"(nameless ululation)"
;
check
(
25
,
s
,
"Tekeli-li!"
);
s
=
#
"int"
.
class
.
getName
();
check
(
31
,
s
,
QuotedIdent_BAD61
.
class
.
getName
()+
"$int"
);
Class
x86
=
Class
.
forName
(
QuotedIdent_BAD61
.
class
.
getName
()+
"$*86"
);
if
(
x86
!=
#
"*86"
.
class
)
check
(
32
,
"reflected "
+
x86
,
"static "
+
#
"*86"
.
class
);
s
=
(
String
)
x86
.
getDeclaredMethod
(
"555-1212"
).
invoke
(
#
"MAKE-*86"
());
check
(
31
,
s
,
"[*86.555-1212]"
);
System
.
out
.
println
(
"OK"
);
}
}
interface
#"
Yog
-
Shoggoth
" {
final String #"
(
nameless
ululation
)
" = "
Tekeli
-
li
!
"
;
}
test/tools/javac/quid/QuotedIdent_BAD62.java
已删除
100644 → 0
浏览文件 @
ef999fc9
/*
* Copyright 2008 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 6746458
* ##summary Verify correct lexing of quoted identifiers.
* ##author jrose
*
* ##library ..
* ##run main quid.QuotedIdent_BAD62
*/
/*
* Standalone testing:
* <code>
* $ cd $MY_REPO_DIR/langtools
* $ (cd make; make)
* $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent_BAD62.java
* $ java -version # should print 1.6 or later
* $ java -cp dist quid.QuotedIdent_BAD62
* </code>
*/
package
quid
;
public
class
QuotedIdent_BAD62
{
static
void
check
(
int
testid
,
String
have
,
String
expect
)
throws
RuntimeException
{
if
((
have
==
null
&&
have
!=
expect
)
||
(
have
!=
null
&&
!
have
.
equals
(
expect
)))
{
String
msg
=
"TEST "
+
testid
+
": HAVE \""
+
have
+
"\" EXPECT \""
+
expect
+
"\""
;
System
.
out
.
println
(
"StringConversion: "
+
msg
);
throw
new
RuntimeException
(
msg
);
}
}
// negative tests:
//static class #"" { } //BAD empty ident name
static
class
#"<
foo
>
" { } //BAD bad char in ident name
/*static class /*(//BAD ident name interrupted by newline) #"
jump:
" { } /* uncomment previous line to attempt class w/ bad name */
static class #"
int
" extends Number {
final int #"
int
";
#"
int
"(int #"
int
") {
this.#"
int
" = #"
int
";
}
static #"
int
" valueOf(int #"
int
") {
return new #"
int
"(#"
int
");
}
public int intValue() { return #"
int
"; }
public long longValue() { return #"
int
"; }
public float floatValue() { return #"
int
"; }
public double doubleValue() { return #"
int
"; }
public String toString() { return String.valueOf(#"
int
"); }
}
class #"
*
86
" {
String #"
555
-
1212
"() { return "
[*
86.555
-
1212
]
"; }
}
static#"
*
86
"#"
MAKE
-*
86
"() { // note close spacing
return new QuotedIdent_BAD62().new#"
*
86
"();
}
static String bar() { return "
[
bar
]
"; }
public static void main(String[] args) throws Exception {
String s;
String #"
sticky
\'
wicket
" = "
wicked
'
stick
";
s = #"
sticky
'
wicket
";
check(11, s, "
wicked
\'
stick
");
check(12, #"
s
", s);
check(13, #"
\
163
", s);
s = #"
QuotedIdent_BAD62
".bar();
check(21, s, "
[
bar
]
");
s = #"
int
".valueOf(123).toString();
check(22, s, "
123
");
s = #"
MAKE
-*
86
"().#"
555
-
1212
"();
check(23, s, "
[*
86.555
-
1212
]
");
class#"
{{{
inmost
}}}
" { }
s = new#"
{{{
inmost
}}}
"().getClass().getName();
if (!s.endsWith("
{{{
inmost
}}}
"))
check(24, s, "
should
end
with
\
"{{{inmost}}}\""
);
s
=
#
"Yog-Shoggoth"
.
#
"(nameless ululation)"
;
check
(
25
,
s
,
"Tekeli-li!"
);
s
=
#
"int"
.
class
.
getName
();
check
(
31
,
s
,
QuotedIdent_BAD62
.
class
.
getName
()+
"$int"
);
Class
x86
=
Class
.
forName
(
QuotedIdent_BAD62
.
class
.
getName
()+
"$*86"
);
if
(
x86
!=
#
"*86"
.
class
)
check
(
32
,
"reflected "
+
x86
,
"static "
+
#
"*86"
.
class
);
s
=
(
String
)
x86
.
getDeclaredMethod
(
"555-1212"
).
invoke
(
#
"MAKE-*86"
());
check
(
31
,
s
,
"[*86.555-1212]"
);
System
.
out
.
println
(
"OK"
);
}
}
interface
#"
Yog
-
Shoggoth
" {
final String #"
(
nameless
ululation
)
" = "
Tekeli
-
li
!
"
;
}
test/tools/javac/quid/QuotedIdent_BAD63.java
已删除
100644 → 0
浏览文件 @
ef999fc9
/*
* Copyright 2008 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 6746458
* ##summary Verify correct lexing of quoted identifiers.
* ##author jrose
*
* ##library ..
* ##run main quid.QuotedIdent_BAD63
*/
/*
* Standalone testing:
* <code>
* $ cd $MY_REPO_DIR/langtools
* $ (cd make; make)
* $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent_BAD63.java
* $ java -version # should print 1.6 or later
* $ java -cp dist quid.QuotedIdent_BAD63
* </code>
*/
package
quid
;
public
class
QuotedIdent_BAD63
{
static
void
check
(
int
testid
,
String
have
,
String
expect
)
throws
RuntimeException
{
if
((
have
==
null
&&
have
!=
expect
)
||
(
have
!=
null
&&
!
have
.
equals
(
expect
)))
{
String
msg
=
"TEST "
+
testid
+
": HAVE \""
+
have
+
"\" EXPECT \""
+
expect
+
"\""
;
System
.
out
.
println
(
"StringConversion: "
+
msg
);
throw
new
RuntimeException
(
msg
);
}
}
// negative tests:
//static class #"" { } //BAD empty ident name
//static class #"<foo>" { } //BAD bad char in ident name
static
class
/*(//
BAD
ident
name
interrupted
by
newline
)
#
"jump:
"
{
}
/* uncomment previous line to attempt class w/ bad name */
static
class
#"
int
" extends Number {
final int #"
int
";
#"
int
"(int #"
int
") {
this.#"
int
" = #"
int
";
}
static #"
int
" valueOf(int #"
int
") {
return new #"
int
"(#"
int
");
}
public int intValue() { return #"
int
"; }
public long longValue() { return #"
int
"; }
public float floatValue() { return #"
int
"; }
public double doubleValue() { return #"
int
"; }
public String toString() { return String.valueOf(#"
int
"); }
}
class #"
*
86
" {
String #"
555
-
1212
"() { return "
[*
86.555
-
1212
]
"; }
}
static#"
*
86
"#"
MAKE
-*
86
"() { // note close spacing
return new QuotedIdent_BAD63().new#"
*
86
"();
}
static String bar() { return "
[
bar
]
"; }
public static void main(String[] args) throws Exception {
String s;
String #"
sticky
\'
wicket
" = "
wicked
'
stick
";
s = #"
sticky
'
wicket
";
check(11, s, "
wicked
\'
stick
");
check(12, #"
s
", s);
check(13, #"
\
163
", s);
s = #"
QuotedIdent_BAD63
".bar();
check(21, s, "
[
bar
]
");
s = #"
int
".valueOf(123).toString();
check(22, s, "
123
");
s = #"
MAKE
-*
86
"().#"
555
-
1212
"();
check(23, s, "
[*
86.555
-
1212
]
");
class#"
{{{
inmost
}}}
" { }
s = new#"
{{{
inmost
}}}
"().getClass().getName();
if (!s.endsWith("
{{{
inmost
}}}
"))
check(24, s, "
should
end
with
\
"{{{inmost}}}\""
);
s
=
#
"Yog-Shoggoth"
.
#
"(nameless ululation)"
;
check
(
25
,
s
,
"Tekeli-li!"
);
s
=
#
"int"
.
class
.
getName
();
check
(
31
,
s
,
QuotedIdent_BAD63
.
class
.
getName
()+
"$int"
);
Class
x86
=
Class
.
forName
(
QuotedIdent_BAD63
.
class
.
getName
()+
"$*86"
);
if
(
x86
!=
#
"*86"
.
class
)
check
(
32
,
"reflected "
+
x86
,
"static "
+
#
"*86"
.
class
);
s
=
(
String
)
x86
.
getDeclaredMethod
(
"555-1212"
).
invoke
(
#
"MAKE-*86"
());
check
(
31
,
s
,
"[*86.555-1212]"
);
System
.
out
.
println
(
"OK"
);
}
}
interface
#"
Yog
-
Shoggoth
" {
final String #"
(
nameless
ululation
)
" = "
Tekeli
-
li
!
"
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录