RFR 8072615: test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java wrong on Windows

Weijun Wang weijun.wang at oracle.com
Thu Feb 5 11:54:58 UTC 2015


Hi All

A test helper tries to parse the "test.src.path" system property using 
delimiter ":". This is not correct on Windows.

The fix is simply

diff --git a/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java 
b/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java
--- a/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java
+++ b/test/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java
@@ -56,7 +56,7 @@
       */
      public SimpleSSLContext () throws IOException {
          String paths = System.getProperty("test.src.path");
-        StringTokenizer st = new StringTokenizer(paths,":");
+        StringTokenizer st = new StringTokenizer(paths, 
File.pathSeparator);
          boolean securityExceptions = false;
          while (st.hasMoreTokens()) {
              String path = st.nextToken();

The test still runs fine now, because when "C:\x;c:\y" is divided into 
"C", "\x;c" and "\y". The useful part "\y" still somehow works. If 
test.src and jtreg working directory are on different drives, the test 
would fail.

Thanks
Max



More information about the security-dev mailing list