changeset 3200:9f3a70d14025

8146727: test tools/sjavac/IncludeExcludePatterns.java fails on Windows Reviewed-by: darcy
author jjg
date Fri, 08 Jan 2016 22:24:15 -0800
parents 3a6560c043d2
children c3b040ed4122
files test/tools/sjavac/IncludeExcludePatterns.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/sjavac/IncludeExcludePatterns.java	Fri Jan 08 17:02:29 2016 -0700
+++ b/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 + " {}");
     }