Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
6a03b12d
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看板
提交
6a03b12d
编写于
1月 11, 2012
作者:
K
ksrini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7125442: jar application located in two bytes character named folder cannot be run with JRE 7 u1/u2
Reviewed-by: sherman, mchung, darcy
上级
9f1249ce
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
135 addition
and
14 deletion
+135
-14
src/share/bin/java.c
src/share/bin/java.c
+2
-9
test/tools/launcher/I18NJarTest.java
test/tools/launcher/I18NJarTest.java
+110
-0
test/tools/launcher/TestHelper.java
test/tools/launcher/TestHelper.java
+23
-5
未找到文件。
src/share/bin/java.c
浏览文件 @
6a03b12d
/*
* Copyright (c) 1995, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 201
2
, 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
...
...
@@ -1225,14 +1225,7 @@ LoadMainClass(JNIEnv *env, int mode, char *name)
"checkAndLoadMain"
,
"(ZILjava/lang/String;)Ljava/lang/Class;"
));
switch
(
mode
)
{
case
LM_CLASS
:
str
=
NewPlatformString
(
env
,
name
);
break
;
default:
str
=
(
*
env
)
->
NewStringUTF
(
env
,
name
);
break
;
}
str
=
NewPlatformString
(
env
,
name
);
result
=
(
*
env
)
->
CallStaticObjectMethod
(
env
,
cls
,
mid
,
USE_STDERR
,
mode
,
str
);
if
(
JLI_IsTraceLauncher
())
{
...
...
test/tools/launcher/I18NJarTest.java
0 → 100644
浏览文件 @
6a03b12d
/*
* 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 7125442
* @summary ensures a jar path as well as a class located in a path containing
* unicode characters are launched.
* @compile -XDignore.symbol.file I18NJarTest.java TestHelper.java
* @run main/othervm I18NJarTest
*/
import
java.io.File
;
import
java.util.Locale
;
/*
* Note 1: the system must have the correct Locale, in order for the test to
* work correctly, on those systems that do not comply, the test will succeed.
* Here are some guidelines to set the locale correctly.
* On Windows: ControlPanel->Regional Settings,
* ensure that "Japanese" is selected and checked, and in
* "Code page conversion tables", the following must be checked,
* 932 (ANSI/OEM - Japanese Shift-JIS).
* On Unix: use "locale -a" verify one of these exist ja_JP.UTF-8 or
* ja_JP.utf8 or ja_JP.ujis, and export one of them with LC_ALL.
*
*
* Note 2: since we need to set the locale, it is safest to execute this test
* in its own VM (othervm mode), such that the ensuing tests can run unperturbed,
* regardless of the outcome.
*/
public
class
I18NJarTest
{
private
static
final
File
cwd
=
new
File
(
"."
);
private
static
final
File
dir
=
new
File
(
"\uFF66\uFF67\uFF68\uFF69"
);
private
static
final
String
encoding
=
System
.
getProperty
(
"sun.jnu.encoding"
,
""
);
public
static
void
main
(
String
...
args
)
throws
Exception
{
boolean
localeAvailable
=
false
;
for
(
Locale
l
:
Locale
.
getAvailableLocales
())
{
if
(
l
.
toLanguageTag
().
equals
(
Locale
.
JAPAN
.
toLanguageTag
()))
{
localeAvailable
=
true
;
break
;
}
}
if
(!
localeAvailable
)
{
System
.
out
.
println
(
"Warning: locale: "
+
Locale
.
JAPAN
+
" not found, test passes vacuosly"
);
return
;
}
if
(
encoding
.
equals
(
"MS932"
)
||
encoding
.
equals
(
"UTF-8"
))
{
Locale
.
setDefault
(
Locale
.
JAPAN
);
System
.
out
.
println
(
"using locale "
+
Locale
.
JAPAN
+
", encoding "
+
encoding
);
}
else
{
System
.
out
.
println
(
"Warning: current encoding is "
+
encoding
+
"this test requires MS932 <Ja> or UTF-8,"
+
" test passes vacuosly"
);
return
;
}
dir
.
mkdir
();
File
dirfile
=
new
File
(
dir
,
"foo.jar"
);
TestHelper
.
createJar
(
dirfile
,
"public static void main(String... args) {"
,
"System.out.println(\"Hello World\");"
,
"System.exit(0);"
,
"}"
);
// remove the class files, to ensure that the class is indeed picked up
// from the jar file and not from ambient classpath.
File
[]
classFiles
=
cwd
.
listFiles
(
TestHelper
.
createFilter
(
TestHelper
.
CLASS_FILE_EXT
));
for
(
File
f
:
classFiles
)
{
f
.
delete
();
}
// test with a jar file
TestHelper
.
TestResult
tr
=
TestHelper
.
doExec
(
TestHelper
.
javaCmd
,
"-jar"
,
dirfile
.
getAbsolutePath
());
System
.
out
.
println
(
tr
);
if
(!
tr
.
isOK
())
{
throw
new
RuntimeException
(
"TEST FAILED"
);
}
// test the same class but by specifying it as a classpath
tr
=
TestHelper
.
doExec
(
TestHelper
.
javaCmd
,
"-cp"
,
dirfile
.
getAbsolutePath
(),
"Foo"
);
System
.
out
.
println
(
tr
);
if
(!
tr
.
isOK
())
{
throw
new
RuntimeException
(
"TEST FAILED"
);
}
}
}
test/tools/launcher/TestHelper.java
浏览文件 @
6a03b12d
/*
* Copyright (c) 2008, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 201
2
, 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
...
...
@@ -21,23 +21,24 @@
* questions.
*/
import
java.nio.file.attribute.BasicFileAttributes
;
import
java.nio.file.FileVisitResult
;
import
java.nio.file.SimpleFileVisitor
;
import
javax.tools.ToolProvider
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileFilter
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.PrintStream
;
import
java.nio.file.attribute.BasicFileAttributes
;
import
java.nio.file.Files
;
import
java.nio.file.FileVisitResult
;
import
java.nio.file.SimpleFileVisitor
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
javax.tools.JavaCompiler
;
import
javax.tools.ToolProvider
;
import
static
java
.
nio
.
file
.
StandardCopyOption
.*;
...
...
@@ -68,6 +69,10 @@ public enum TestHelper {
static
final
boolean
isDualMode
=
isSolaris
;
static
final
boolean
isSparc
=
System
.
getProperty
(
"os.arch"
).
startsWith
(
"sparc"
);
static
final
String
JAVA_FILE_EXT
=
".java"
;
static
final
String
CLASS_FILE_EXT
=
".class"
;
static
final
String
JAR_FILE_EXT
=
".jar"
;
static
int
testExitValue
=
0
;
static
{
...
...
@@ -303,6 +308,19 @@ public enum TestHelper {
}
}
static
FileFilter
createFilter
(
final
String
extension
)
{
return
new
FileFilter
()
{
@Override
public
boolean
accept
(
File
pathname
)
{
String
name
=
pathname
.
getName
();
if
(
name
.
endsWith
(
extension
))
{
return
true
;
}
return
false
;
}
};
}
/*
* A class to encapsulate the test results and stuff, with some ease
* of use methods to check the test results.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录