File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
test/langtools/tools/javac/newlines Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2013, 2016 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2013, 2024 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -58,8 +58,9 @@ public static void main(String args[]) throws Exception {
5858 .options ("-J-Dline.separator='@'" )
5959 .run (Task .Expect .FAIL );
6060
61- List <String > lines = Files .readAllLines (javacOutput .toPath (),
62- Charset .defaultCharset ());
61+ String encoding = System .getProperty ("native.encoding" );
62+ Charset cs = (encoding != null ) ? Charset .forName (encoding ) : Charset .defaultCharset ();
63+ List <String > lines = Files .readAllLines (javacOutput .toPath (), cs );
6364 if (lines .size () != 1 ) {
6465 throw new AssertionError ("The compiler output should have one line only" );
6566 }
You can’t perform that action at this time.
0 commit comments