diff --git a/test/tools/javac/parser/netbeans/JavacParserTest.java b/test/tools/javac/parser/JavacParserTest.java similarity index 99% rename from test/tools/javac/parser/netbeans/JavacParserTest.java rename to test/tools/javac/parser/JavacParserTest.java index 264e2de15ad22817b71bd5518c03a5bb38fd2178..7cfd0070ab864bf910e04283a0accf5136a5b0e2 100644 --- a/test/tools/javac/parser/netbeans/JavacParserTest.java +++ b/test/tools/javac/parser/JavacParserTest.java @@ -25,7 +25,7 @@ * @test * @bug 7073631 * @summary tests error and diagnostics positions - * @author jan.lahoda@oracle.com + * @author Jan Lahoda */ import com.sun.source.tree.BinaryTree; @@ -83,6 +83,12 @@ public class JavacParserTest extends TestCase { return text; } } + /* + * converts Windows to Unix style LFs for comparing strings + */ + private String normalize(String in) { + return in.replace(System.getProperty("line.separator"), "\n"); + } public CompilationUnitTree getCompilationUnitTree(String code) throws IOException { @@ -95,9 +101,7 @@ public class JavacParserTest extends TestCase { public List getErroneousTreeValues(ErroneousTree node) { List values = new ArrayList<>(); - if (node.getErrorTrees() != null) { - for (Tree t : node.getErrorTrees()) { values.add(t.toString()); } @@ -786,7 +790,7 @@ public class JavacParserTest extends TestCase { @Override public Void visitErroneous(ErroneousTree node, Void p) { - values.add(getErroneousTreeValues(node).toString()); + values.add(normalize(getErroneousTreeValues(node).toString())); return null; } }.scan(cut, null);