8146727: test tools/sjavac/IncludeExcludePatterns.java fails on Windows
authorjjg
Fri, 08 Jan 2016 22:24:15 -0800
changeset 34996 ed25a4c782c2
parent 34995 e4e19f521ee7
child 34997 8174a7d851fb
8146727: test tools/sjavac/IncludeExcludePatterns.java fails on Windows Reviewed-by: darcy
langtools/test/tools/sjavac/IncludeExcludePatterns.java
--- a/langtools/test/tools/sjavac/IncludeExcludePatterns.java	Fri Jan 08 17:02:29 2016 -0700
+++ b/langtools/test/tools/sjavac/IncludeExcludePatterns.java	Fri Jan 08 22:24:15 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -35,6 +35,7 @@
 import com.sun.tools.javac.util.Assert;
 import com.sun.tools.sjavac.server.Sjavac;
 
+import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -104,7 +105,7 @@
 
     // Puts an empty (dummy) class definition in the given path.
     void writeDummyClass(Path javaFile) throws IOException {
-        String pkg = javaFile.getParent().toString().replace('/', '.');
+        String pkg = javaFile.getParent().toString().replace(File.separatorChar, '.');
         String cls = javaFile.getFileName().toString().replace(".java", "");
         toolbox.writeFile(SRC.resolve(javaFile), "package " + pkg + "; class " + cls + " {}");
     }