Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9342f2b4
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9342f2b4
编写于
4月 24, 2012
作者:
K
ksrini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7151434: java -jar -XX crashes java launcher
Reviewed-by: mchung, darcy
上级
f9451ebf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
48 addition
and
21 deletion
+48
-21
src/share/bin/java.c
src/share/bin/java.c
+7
-0
test/tools/launcher/Arrrghs.java
test/tools/launcher/Arrrghs.java
+8
-1
test/tools/launcher/TestHelper.java
test/tools/launcher/TestHelper.java
+33
-20
未找到文件。
src/share/bin/java.c
浏览文件 @
9342f2b4
...
...
@@ -695,6 +695,13 @@ SetClassPath(const char *s)
char
*
def
;
const
char
*
orig
=
s
;
static
const
char
format
[]
=
"-Djava.class.path=%s"
;
/*
* usually we should not get a null pointer, but there are cases where
* we might just get one, in which case we simply ignore it, and let the
* caller deal with it
*/
if
(
s
==
NULL
)
return
;
s
=
JLI_WildcardExpandClasspath
(
s
);
def
=
JLI_MemAlloc
(
sizeof
(
format
)
-
2
/* strlen("%s") */
...
...
test/tools/launcher/Arrrghs.java
浏览文件 @
9342f2b4
...
...
@@ -24,7 +24,7 @@
/**
* @test
* @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938
* 6894719 6968053
* 6894719 6968053
7151314
* @summary Argument parsing validation.
* @compile -XDignore.symbol.file Arrrghs.java
* @run main Arrrghs
...
...
@@ -237,6 +237,13 @@ public class Arrrghs extends TestHelper {
tr
.
checkNegative
();
tr
.
isNotZeroOutput
();
System
.
out
.
println
(
tr
);
// 7151314, test for non-negative exit value for an incorrectly formed
// command line, '% java -jar -W', note the bogus -W
tr
=
doExec
(
javaCmd
,
"-jar"
,
"-W"
);
tr
.
checkNegative
();
tr
.
contains
(
"Unrecognized option: -W"
);
System
.
out
.
println
(
tr
);
}
/*
...
...
test/tools/launcher/TestHelper.java
浏览文件 @
9342f2b4
...
...
@@ -21,6 +21,8 @@
* questions.
*/
import
java.io.StringWriter
;
import
java.io.PrintWriter
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileFilter
;
...
...
@@ -87,6 +89,7 @@ public class TestHelper {
static
final
String
EXE_FILE_EXT
=
".exe"
;
static
final
String
JLDEBUG_KEY
=
"_JAVA_LAUNCHER_DEBUG"
;
static
final
String
EXPECTED_MARKER
=
"TRACER_MARKER:About to EXEC"
;
static
final
String
TEST_PREFIX
=
"###TestError###: "
;
static
int
testExitValue
=
0
;
...
...
@@ -376,7 +379,8 @@ public class TestHelper {
* of use methods to check the test results.
*/
static
class
TestResult
{
StringBuilder
status
;
PrintWriter
status
;
StringWriter
sw
;
int
exitValue
;
List
<
String
>
testOutput
;
Map
<
String
,
String
>
env
;
...
...
@@ -384,27 +388,33 @@ public class TestHelper {
public
TestResult
(
String
str
,
int
rv
,
List
<
String
>
oList
,
Map
<
String
,
String
>
env
,
Throwable
t
)
{
status
=
new
StringBuilder
(
"Executed command: "
+
str
+
"\n"
);
sw
=
new
StringWriter
();
status
=
new
PrintWriter
(
sw
);
status
.
println
(
"Executed command: "
+
str
+
"\n"
);
exitValue
=
rv
;
testOutput
=
oList
;
this
.
env
=
env
;
this
.
t
=
t
;
}
void
appendStatus
(
String
x
)
{
status
=
status
.
append
(
" "
+
x
+
"\n"
);
void
appendError
(
String
x
)
{
status
.
println
(
TEST_PREFIX
+
x
);
}
void
indentStatus
(
String
x
)
{
status
.
println
(
" "
+
x
);
}
void
checkNegative
()
{
if
(
exitValue
==
0
)
{
append
Status
(
"Error:
test must not return 0 exit value"
);
append
Error
(
"
test must not return 0 exit value"
);
testExitValue
++;
}
}
void
checkPositive
()
{
if
(
exitValue
!=
0
)
{
append
Status
(
"Error:
test did not return 0 exit value"
);
append
Error
(
"
test did not return 0 exit value"
);
testExitValue
++;
}
}
...
...
@@ -415,7 +425,7 @@ public class TestHelper {
boolean
isZeroOutput
()
{
if
(!
testOutput
.
isEmpty
())
{
append
Status
(
"Error:
No message from cmd please"
);
append
Error
(
"
No message from cmd please"
);
testExitValue
++;
return
false
;
}
...
...
@@ -424,7 +434,7 @@ public class TestHelper {
boolean
isNotZeroOutput
()
{
if
(
testOutput
.
isEmpty
())
{
append
Status
(
"Error:
Missing message"
);
append
Error
(
"
Missing message"
);
testExitValue
++;
return
false
;
}
...
...
@@ -433,22 +443,25 @@ public class TestHelper {
@Override
public
String
toString
()
{
status
.
append
(
"++++Begin Test Info++++\n
"
);
status
.
append
(
"++++Test Environment++++\n
"
);
status
.
println
(
"++++Begin Test Info++++
"
);
status
.
println
(
"++++Test Environment++++
"
);
for
(
String
x
:
env
.
keySet
())
{
status
.
append
(
x
).
append
(
"="
).
append
(
env
.
get
(
x
)).
append
(
"\n"
);
indentStatus
(
x
+
"="
+
env
.
get
(
x
)
);
}
status
.
append
(
"++++Test Output++++\n
"
);
status
.
println
(
"++++Test Output++++
"
);
for
(
String
x
:
testOutput
)
{
append
Status
(
x
);
indent
Status
(
x
);
}
status
.
append
(
"++++Test Stack Trace++++\n
"
);
status
.
append
(
t
.
toString
());
status
.
println
(
"++++Test Stack Trace++++
"
);
status
.
println
(
t
.
toString
());
for
(
StackTraceElement
e
:
t
.
getStackTrace
())
{
status
.
append
(
e
.
toString
());
indentStatus
(
e
.
toString
());
}
status
.
append
(
"++++End of Test Info++++\n"
);
return
status
.
toString
();
status
.
println
(
"++++End of Test Info++++"
);
status
.
flush
();
String
out
=
sw
.
toString
();
status
.
close
();
return
out
;
}
boolean
contains
(
String
str
)
{
...
...
@@ -457,7 +470,7 @@ public class TestHelper {
return
true
;
}
}
append
Status
(
"Error:
string <"
+
str
+
"> not found"
);
append
Error
(
"
string <"
+
str
+
"> not found"
);
testExitValue
++;
return
false
;
}
...
...
@@ -468,7 +481,7 @@ public class TestHelper {
return
true
;
}
}
append
Status
(
"Error:
string <"
+
stringToMatch
+
"> not found"
);
append
Error
(
"
string <"
+
stringToMatch
+
"> not found"
);
testExitValue
++;
return
false
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录