|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
25 | 25 | * @test
|
26 | 26 | * @bug 4330479
|
27 | 27 | * @summary ASCII SUB character is rejected in multi-line comments
|
28 |
| - * @library /tools/lib |
29 |
| - * @modules jdk.compiler/com.sun.tools.javac.api |
30 |
| - * jdk.compiler/com.sun.tools.javac.main |
31 |
| - * @build toolbox.ToolBox toolbox.JavacTask |
32 |
| - * @run main SubChar |
| 28 | + * @author gafter |
| 29 | + * |
| 30 | + * @compile SubChar.java |
33 | 31 | */
|
34 | 32 |
|
35 |
| -import toolbox.JavacTask; |
36 |
| -import toolbox.JavaTask; |
37 |
| -import toolbox.Task; |
38 |
| -import toolbox.ToolBox; |
39 |
| - |
40 |
| - |
41 |
| -public class SubChar { |
42 |
| - private static final ToolBox TOOLBOX = new ToolBox(); |
43 | 33 |
|
44 |
| - private static final String SOURCE = """ |
45 |
| - /* |
46 |
| - Note: this source file has been crafted very carefully to end with the |
47 |
| - unicode escape sequence for the control-Z character without a |
48 |
| - following newline. The scanner is specified to allow control-Z there. |
49 |
| - If you edit this source file, please make sure that your editor does |
50 |
| - not insert a newline after that trailing line. |
51 |
| - */ |
52 |
| -
|
53 |
| - /** \\u001A */ |
54 |
| - class ControlZTest { |
55 |
| - public static void main(String args[]) { |
56 |
| - return; |
57 |
| - } |
58 |
| - } |
59 |
| - /* \\u001A */\ |
60 |
| - """; |
| 34 | +/* |
| 35 | +Note: this source file has been crafted very carefully to end with the |
| 36 | +unicode escape sequence for the control-Z character without a |
| 37 | +following newline. The scanner is specified to allow control-Z there. |
| 38 | +If you edit this source file, please make sure that your editor does |
| 39 | +not insert a newline after that trailing line. |
| 40 | +*/ |
61 | 41 |
|
62 |
| - public static void main(String... args) { |
63 |
| - String output = new JavacTask(TOOLBOX) |
64 |
| - .sources(SOURCE) |
65 |
| - .classpath(".") |
66 |
| - .options("-encoding", "utf8") |
67 |
| - .run() |
68 |
| - .writeAll() |
69 |
| - .getOutput(Task.OutputKind.DIRECT); |
70 |
| - System.out.println(output); |
71 |
| - } |
| 42 | +/** \u001A */ |
| 43 | +class SubChar { |
| 44 | + public static void main(String args[]) { |
| 45 | + return; |
| 46 | + } |
72 | 47 | }
|
| 48 | +/* \u001A */ |
0 commit comments