Skip to content

Commit 4144ef3

Browse files
Kimura YukihiroPaul Hohensee
Kimura Yukihiro
authored and
Paul Hohensee
committed
8318410: jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh fails on Japanese Windows
Reviewed-by: phh Backport-of: d051f22284e7ccc288c658588f73da672d9bfacd
1 parent 38036c1 commit 4144ef3

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

test/jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,18 @@ echo "Creating manifest file..."
6464
# java Setup <workdir> <premain-class>
6565
# - outputs boot class path to boot.dir
6666

67-
"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent
67+
OS=`uname -s`
68+
case ${OS} in
69+
CYGWIN*)
70+
CYGWIN="CYGWIN"
71+
;;
72+
*)
73+
CYGWIN=""
74+
;;
75+
esac
76+
77+
"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent "${CYGWIN}"
78+
6879
BOOTDIR=`cat ${TESTCLASSES}/boot.dir`
6980

7081
echo "Created ${BOOTDIR}"

test/jdk/java/lang/instrument/BootClassPath/Setup.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,10 @@ public static void main(String[] args) throws Exception {
4545
}
4646
String workDir = args[0];
4747
String premainClass = args[1];
48+
boolean isCygwin = false;
49+
if (args.length==3 && args[2].equals("CYGWIN")) {
50+
isCygwin = true;
51+
}
4852

4953
String manifestFile = workDir + fileSeparator + "MANIFEST.MF";
5054
String bootClassPath = "boot" + suffix();
@@ -94,7 +98,12 @@ public static void main(String[] args) throws Exception {
9498
*/
9599
f = new File(workDir + fileSeparator + "boot.dir");
96100
try (FileOutputStream out = new FileOutputStream(f)) {
97-
out.write(bootDir.getBytes(defaultEncoding));
101+
if (osName.startsWith("Windows") && isCygwin) {
102+
out.write(bootDir.getBytes("UTF-8"));
103+
}
104+
else {
105+
out.write(bootDir.getBytes(defaultEncoding));
106+
}
98107
}
99108
}
100109

0 commit comments

Comments
 (0)