8146727: test tools/sjavac/IncludeExcludePatterns.java fails on Windows
Reviewed-by: darcy
--- 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 + " {}");
}