8080471: fix usage of replace and file separator in Nashorn tests
authormhaupt
Fri, 15 May 2015 10:21:48 +0200
changeset 30698 2d50f5564f7b
parent 30697 85feee7acc91
child 30699 a2981bee13d2
8080471: fix usage of replace and file separator in Nashorn tests Summary: Two tests should use replace instead of replaceAll, and there is a typo in the usage of File.separator. Reviewed-by: attila, hannesw
nashorn/test/script/nosecurity/JDK-8050964.js
nashorn/test/script/nosecurity/JDK-8055034.js
--- a/nashorn/test/script/nosecurity/JDK-8050964.js	Fri May 15 10:19:37 2015 +0200
+++ b/nashorn/test/script/nosecurity/JDK-8050964.js	Fri May 15 10:21:48 2015 +0200
@@ -47,9 +47,9 @@
 }
 
 var javahome = System.getProperty("java.home");
-var jdepsPath = javahome + "/../bin/jdeps".replaceAll(/\//g, File.separater);
+var jdepsPath = javahome + "/../bin/jdeps".replace(/\//g, File.separator);
 if (! new File(jdepsPath).isFile()) {
-    jdepsPath = javahome + "/bin/jdeps".replaceAll(/\//g, File.separater);
+    jdepsPath = javahome + "/bin/jdeps".replace(/\//g, File.separator);
 }
 
 // run jdep on nashorn.jar - only summary but print profile info
--- a/nashorn/test/script/nosecurity/JDK-8055034.js	Fri May 15 10:19:37 2015 +0200
+++ b/nashorn/test/script/nosecurity/JDK-8055034.js	Fri May 15 10:21:48 2015 +0200
@@ -46,10 +46,10 @@
 
 // we want to use nashorn.jar passed and not the one that comes with JRE
 var jjsCmd = javahome + "/../bin/jjs";
-jjsCmd = jjsCmd.toString().replaceAll(/\//g, File.separater);
+jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
 if (! new File(jjsCmd).isFile()) {
     jjsCmd = javahome + "/bin/jjs";
-    jjsCmd = jjsCmd.toString().replaceAll(/\//g, File.separater);
+    jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
 }
 jjsCmd += " -J-Xbootclasspath/p:" + nashornJar;