author | ksrini |
Wed, 15 Feb 2017 18:07:28 -0800 | |
changeset 43874 | d49715456f51 |
parent 43871 | f164f4506389 |
child 44229 | 6ebcb2cb9507 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
43871
f164f4506389
8173596: JavaCompiler.CompilationTask should support addModules
jjg
parents:
42260
diff
changeset
|
2 |
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
26 |
package com.sun.tools.javac.main; |
|
27 |
||
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
28 |
import java.io.FileNotFoundException; |
10 | 29 |
import java.io.IOException; |
36526 | 30 |
import java.io.InputStream; |
10 | 31 |
import java.io.PrintWriter; |
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
32 |
import java.net.URL; |
27852
2e6ad0e4fe20
8061876: replace java.io.File with java.nio.file.Path (again)
jjg
parents:
27846
diff
changeset
|
33 |
import java.nio.file.NoSuchFileException; |
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
34 |
import java.security.DigestInputStream; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
35 |
import java.security.MessageDigest; |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
36 |
import java.security.NoSuchAlgorithmException; |
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
37 |
import java.util.Set; |
14548
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
38 |
|
6721 | 39 |
import javax.tools.JavaFileManager; |
10 | 40 |
|
14960 | 41 |
import com.sun.tools.javac.api.BasicJavacTask; |
1208 | 42 |
import com.sun.tools.javac.file.CacheFSInfo; |
29780
8f8e54a1fa20
8076420: Consolidate javac file handling in javac.file package
jjg
parents:
27852
diff
changeset
|
43 |
import com.sun.tools.javac.file.BaseFileManager; |
731
1dd22bdb9ca5
6714364: refactor javac File handling code into new javac.file package
jjg
parents:
10
diff
changeset
|
44 |
import com.sun.tools.javac.file.JavacFileManager; |
37394
c36230ee15d9
8149757: Implement Multi-Release JAR aware JavacFileManager for javac
jjg
parents:
36526
diff
changeset
|
45 |
import com.sun.tools.javac.jvm.Target; |
43874
d49715456f51
8173308: JAVAC_OPTIONS should be updated to align with JAVA_OPTIONS
ksrini
parents:
43871
diff
changeset
|
46 |
import com.sun.tools.javac.main.CommandLine.UnmatchedQuote; |
31506
4e07f827a794
8072480: javac should support compilation for a specific platform version
jlahoda
parents:
30012
diff
changeset
|
47 |
import com.sun.tools.javac.platform.PlatformDescription; |
14548
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
48 |
import com.sun.tools.javac.processing.AnnotationProcessingError; |
10 | 49 |
import com.sun.tools.javac.util.*; |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
50 |
import com.sun.tools.javac.util.Log.PrefixKind; |
14548
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
51 |
import com.sun.tools.javac.util.Log.WriterKind; |
10 | 52 |
|
14548
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
53 |
/** This class provides a command line interface to the javac compiler. |
10 | 54 |
* |
5847
1908176fd6e3
6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
55 |
* <p><b>This is NOT part of any supported API. |
1908176fd6e3
6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
56 |
* If you write code that depends on this, you do so at your own risk. |
10 | 57 |
* This code and its internal interfaces are subject to change or |
58 |
* deletion without notice.</b> |
|
59 |
*/ |
|
60 |
public class Main { |
|
61 |
||
62 |
/** The name of the compiler, for use in diagnostics. |
|
63 |
*/ |
|
64 |
String ownName; |
|
65 |
||
40232
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
66 |
/** The writer to use for normal output. |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
67 |
*/ |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
68 |
PrintWriter stdOut; |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
69 |
|
10 | 70 |
/** The writer to use for diagnostic output. |
71 |
*/ |
|
40232
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
72 |
PrintWriter stdErr; |
10 | 73 |
|
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
74 |
/** The log to use for diagnostic output. |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
75 |
*/ |
15724 | 76 |
public Log log; |
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
77 |
|
10 | 78 |
/** |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
79 |
* If true, certain errors will cause an exception, such as command line |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
80 |
* arg errors, or exceptions in user provided code. |
10 | 81 |
*/ |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
82 |
boolean apiMode; |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
83 |
|
43874
d49715456f51
8173308: JAVAC_OPTIONS should be updated to align with JAVA_OPTIONS
ksrini
parents:
43871
diff
changeset
|
84 |
private static final String ENV_OPT_NAME = "JDK_JAVAC_OPTIONS"; |
10 | 85 |
|
86 |
/** Result codes. |
|
87 |
*/ |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
88 |
public enum Result { |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
89 |
OK(0), // Compilation completed with no errors. |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
90 |
ERROR(1), // Completed but reported errors. |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
91 |
CMDERR(2), // Bad command-line arguments |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
92 |
SYSERR(3), // System error or resource exhaustion. |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
93 |
ABNORMAL(4); // Compiler terminated abnormally |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
94 |
|
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
95 |
Result(int exitCode) { |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
96 |
this.exitCode = exitCode; |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
97 |
} |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
98 |
|
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
99 |
public boolean isOK() { |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
100 |
return (exitCode == 0); |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
101 |
} |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
102 |
|
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
103 |
public final int exitCode; |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
104 |
} |
10 | 105 |
|
106 |
/** |
|
107 |
* Construct a compiler instance. |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
108 |
* @param name the name of this tool |
10 | 109 |
*/ |
110 |
public Main(String name) { |
|
40232
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
111 |
this.ownName = name; |
10 | 112 |
} |
113 |
||
114 |
/** |
|
115 |
* Construct a compiler instance. |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
116 |
* @param name the name of this tool |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
117 |
* @param out a stream to which to write messages |
10 | 118 |
*/ |
119 |
public Main(String name, PrintWriter out) { |
|
120 |
this.ownName = name; |
|
40232
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
121 |
this.stdOut = this.stdErr = out; |
10 | 122 |
} |
15724 | 123 |
|
41448 | 124 |
/** |
125 |
* Construct a compiler instance. |
|
126 |
* @param name the name of this tool |
|
127 |
* @param out a stream to which to write expected output |
|
128 |
* @param err a stream to which to write diagnostic output |
|
129 |
*/ |
|
130 |
public Main(String name, PrintWriter out, PrintWriter err) { |
|
131 |
this.ownName = name; |
|
132 |
this.stdOut = out; |
|
133 |
this.stdErr = err; |
|
134 |
} |
|
135 |
||
10 | 136 |
/** Report a usage error. |
137 |
*/ |
|
138 |
void error(String key, Object... args) { |
|
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
139 |
if (apiMode) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
140 |
String msg = log.localize(PrefixKind.JAVAC, key, args); |
10 | 141 |
throw new PropagatedException(new IllegalStateException(msg)); |
142 |
} |
|
143 |
warning(key, args); |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
144 |
log.printLines(PrefixKind.JAVAC, "msg.usage", ownName); |
10 | 145 |
} |
146 |
||
147 |
/** Report a warning. |
|
148 |
*/ |
|
149 |
void warning(String key, Object... args) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
150 |
log.printRawLines(ownName + ": " + log.localize(PrefixKind.JAVAC, key, args)); |
10 | 151 |
} |
152 |
||
153 |
||
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
154 |
/** |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
155 |
* Programmatic interface for main function. |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
156 |
* @param args the command line parameters |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
157 |
* @return the result of the compilation |
10 | 158 |
*/ |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
159 |
public Result compile(String[] args) { |
10 | 160 |
Context context = new Context(); |
161 |
JavacFileManager.preRegister(context); // can't create it until Log has been set up |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
162 |
Result result = compile(args, context); |
10 | 163 |
if (fileManager instanceof JavacFileManager) { |
34560
b6a567b677f7
8059976: Convert JavacFileManager to use java.nio.file internally
jjg
parents:
31506
diff
changeset
|
164 |
try { |
b6a567b677f7
8059976: Convert JavacFileManager to use java.nio.file internally
jjg
parents:
31506
diff
changeset
|
165 |
// A fresh context was created above, so jfm must be a JavacFileManager |
b6a567b677f7
8059976: Convert JavacFileManager to use java.nio.file internally
jjg
parents:
31506
diff
changeset
|
166 |
((JavacFileManager)fileManager).close(); |
36526 | 167 |
} catch (IOException ex) { |
168 |
bugMessage(ex); |
|
34560
b6a567b677f7
8059976: Convert JavacFileManager to use java.nio.file internally
jjg
parents:
31506
diff
changeset
|
169 |
} |
10 | 170 |
} |
171 |
return result; |
|
172 |
} |
|
173 |
||
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
174 |
/** |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
175 |
* Internal version of compile, allowing context to be provided. |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
176 |
* Note that the context needs to have a file manager set up. |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
177 |
* @param argv the command line parameters |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
178 |
* @param context the context |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
179 |
* @return the result of the compilation |
10 | 180 |
*/ |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
181 |
public Result compile(String[] argv, Context context) { |
40232
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
182 |
if (stdOut != null) { |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
183 |
context.put(Log.outKey, stdOut); |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
184 |
} |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
185 |
|
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
186 |
if (stdErr != null) { |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
187 |
context.put(Log.errKey, stdErr); |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
188 |
} |
4995ab1a4558
8162359: javac should use stdout for --help and --version
jjg
parents:
39599
diff
changeset
|
189 |
|
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
190 |
log = Log.instance(context); |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
191 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
192 |
if (argv.length == 0) { |
40308
274367a99f98
8136930: Simplify use of module-system options by custom launchers
jjg
parents:
40232
diff
changeset
|
193 |
OptionHelper h = new OptionHelper.GrumpyHelper(log) { |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
194 |
@Override |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
195 |
public String getOwnName() { return ownName; } |
27846 | 196 |
@Override |
197 |
public void put(String name, String value) { } |
|
40308
274367a99f98
8136930: Simplify use of module-system options by custom launchers
jjg
parents:
40232
diff
changeset
|
198 |
}; |
42260
2b4da2bf6660
8169676: boolean result of Option.process is often ignored
jjg
parents:
41448
diff
changeset
|
199 |
try { |
2b4da2bf6660
8169676: boolean result of Option.process is often ignored
jjg
parents:
41448
diff
changeset
|
200 |
Option.HELP.process(h, "-help"); |
2b4da2bf6660
8169676: boolean result of Option.process is often ignored
jjg
parents:
41448
diff
changeset
|
201 |
} catch (Option.InvalidValueException ignore) { |
2b4da2bf6660
8169676: boolean result of Option.process is often ignored
jjg
parents:
41448
diff
changeset
|
202 |
} |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
203 |
return Result.CMDERR; |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
204 |
} |
10 | 205 |
|
43874
d49715456f51
8173308: JAVAC_OPTIONS should be updated to align with JAVA_OPTIONS
ksrini
parents:
43871
diff
changeset
|
206 |
// prefix argv with contents of environment variable and expand @-files |
10 | 207 |
try { |
43874
d49715456f51
8173308: JAVAC_OPTIONS should be updated to align with JAVA_OPTIONS
ksrini
parents:
43871
diff
changeset
|
208 |
argv = CommandLine.parse(ENV_OPT_NAME, argv); |
d49715456f51
8173308: JAVAC_OPTIONS should be updated to align with JAVA_OPTIONS
ksrini
parents:
43871
diff
changeset
|
209 |
} catch (UnmatchedQuote ex) { |
d49715456f51
8173308: JAVAC_OPTIONS should be updated to align with JAVA_OPTIONS
ksrini
parents:
43871
diff
changeset
|
210 |
error("err.unmatched.quote", ex.variableName); |
d49715456f51
8173308: JAVAC_OPTIONS should be updated to align with JAVA_OPTIONS
ksrini
parents:
43871
diff
changeset
|
211 |
return Result.CMDERR; |
27852
2e6ad0e4fe20
8061876: replace java.io.File with java.nio.file.Path (again)
jjg
parents:
27846
diff
changeset
|
212 |
} catch (FileNotFoundException | NoSuchFileException e) { |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
213 |
warning("err.file.not.found", e.getMessage()); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
214 |
return Result.SYSERR; |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
215 |
} catch (IOException ex) { |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
216 |
log.printLines(PrefixKind.JAVAC, "msg.io"); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
217 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
218 |
return Result.SYSERR; |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
219 |
} |
10 | 220 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
221 |
Arguments args = Arguments.instance(context); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
222 |
args.init(ownName, argv); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
223 |
|
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
224 |
if (log.nerrors > 0) |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
225 |
return Result.CMDERR; |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
226 |
|
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
227 |
Options options = Options.instance(context); |
10 | 228 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
229 |
// init Log |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
230 |
boolean forceStdOut = options.isSet("stdout"); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
231 |
if (forceStdOut) { |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
232 |
log.flush(); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
233 |
log.setWriters(new PrintWriter(System.out, true)); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
234 |
} |
10 | 235 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
236 |
// init CacheFSInfo |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
237 |
// allow System property in following line as a Mustang legacy |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
238 |
boolean batchMode = (options.isUnset("nonBatchMode") |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
239 |
&& System.getProperty("nonBatchMode") == null); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
240 |
if (batchMode) |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
241 |
CacheFSInfo.preRegister(context); |
24897
655b72d7b96e
7026941: 199: path options ignored when reusing filemanager across tasks
jjg
parents:
23792
diff
changeset
|
242 |
|
36526 | 243 |
boolean ok = true; |
244 |
||
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
245 |
// init file manager |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
246 |
fileManager = context.get(JavaFileManager.class); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
247 |
if (fileManager instanceof BaseFileManager) { |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
248 |
((BaseFileManager) fileManager).setContext(context); // reinit with options |
36526 | 249 |
ok &= ((BaseFileManager) fileManager).handleOptions(args.getDeferredFileManagerOptions()); |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
250 |
} |
14548
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
251 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
252 |
// handle this here so it works even if no other options given |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
253 |
String showClass = options.get("showClass"); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
254 |
if (showClass != null) { |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
255 |
if (showClass.equals("showClass")) // no value given for option |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
256 |
showClass = "com.sun.tools.javac.Main"; |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
257 |
showClass(showClass); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
258 |
} |
25844
48eab270456c
8048890: Add option to keep track of symbol completion dependencies
mcimadamore
parents:
25445
diff
changeset
|
259 |
|
36526 | 260 |
ok &= args.validate(); |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
261 |
if (!ok || log.nerrors > 0) |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
262 |
return Result.CMDERR; |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
263 |
|
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
264 |
if (args.isEmpty()) |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
265 |
return Result.OK; |
10 | 266 |
|
37394
c36230ee15d9
8149757: Implement Multi-Release JAR aware JavacFileManager for javac
jjg
parents:
36526
diff
changeset
|
267 |
// init Dependencies |
39599 | 268 |
if (options.isSet("debug.completionDeps")) { |
30012
660da74452cf
8078261: Initialization of DocLint triggers out of order initialization of Dependencies
alundblad
parents:
29780
diff
changeset
|
269 |
Dependencies.GraphDependencies.preRegister(context); |
660da74452cf
8078261: Initialization of DocLint triggers out of order initialization of Dependencies
alundblad
parents:
29780
diff
changeset
|
270 |
} |
660da74452cf
8078261: Initialization of DocLint triggers out of order initialization of Dependencies
alundblad
parents:
29780
diff
changeset
|
271 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
272 |
// init plugins |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
273 |
Set<List<String>> pluginOpts = args.getPluginOpts(); |
31506
4e07f827a794
8072480: javac should support compilation for a specific platform version
jlahoda
parents:
30012
diff
changeset
|
274 |
if (!pluginOpts.isEmpty() || context.get(PlatformDescription.class) != null) { |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
275 |
BasicJavacTask t = (BasicJavacTask) BasicJavacTask.instance(context); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
276 |
t.initPlugins(pluginOpts); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
277 |
} |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
278 |
|
37394
c36230ee15d9
8149757: Implement Multi-Release JAR aware JavacFileManager for javac
jjg
parents:
36526
diff
changeset
|
279 |
// init multi-release jar handling |
40308
274367a99f98
8136930: Simplify use of module-system options by custom launchers
jjg
parents:
40232
diff
changeset
|
280 |
if (fileManager.isSupportedOption(Option.MULTIRELEASE.primaryName) == 1) { |
37394
c36230ee15d9
8149757: Implement Multi-Release JAR aware JavacFileManager for javac
jjg
parents:
36526
diff
changeset
|
281 |
Target target = Target.instance(context); |
c36230ee15d9
8149757: Implement Multi-Release JAR aware JavacFileManager for javac
jjg
parents:
36526
diff
changeset
|
282 |
List<String> list = List.of(target.multiReleaseValue()); |
40308
274367a99f98
8136930: Simplify use of module-system options by custom launchers
jjg
parents:
40232
diff
changeset
|
283 |
fileManager.handleOption(Option.MULTIRELEASE.primaryName, list.iterator()); |
37394
c36230ee15d9
8149757: Implement Multi-Release JAR aware JavacFileManager for javac
jjg
parents:
36526
diff
changeset
|
284 |
} |
c36230ee15d9
8149757: Implement Multi-Release JAR aware JavacFileManager for javac
jjg
parents:
36526
diff
changeset
|
285 |
|
30012
660da74452cf
8078261: Initialization of DocLint triggers out of order initialization of Dependencies
alundblad
parents:
29780
diff
changeset
|
286 |
// init JavaCompiler |
660da74452cf
8078261: Initialization of DocLint triggers out of order initialization of Dependencies
alundblad
parents:
29780
diff
changeset
|
287 |
JavaCompiler comp = JavaCompiler.instance(context); |
660da74452cf
8078261: Initialization of DocLint triggers out of order initialization of Dependencies
alundblad
parents:
29780
diff
changeset
|
288 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
289 |
// init doclint |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
290 |
List<String> docLintOpts = args.getDocLintOpts(); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
291 |
if (!docLintOpts.isEmpty()) { |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
292 |
BasicJavacTask t = (BasicJavacTask) BasicJavacTask.instance(context); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
293 |
t.initDocLint(docLintOpts); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
294 |
} |
14960 | 295 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
296 |
if (options.get(Option.XSTDOUT) != null) { |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
297 |
// Stdout reassigned - ask compiler to close it when it is done |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
298 |
comp.closeables = comp.closeables.prepend(log.getWriter(WriterKind.NOTICE)); |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
299 |
} |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
300 |
|
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
301 |
try { |
43871
f164f4506389
8173596: JavaCompiler.CompilationTask should support addModules
jjg
parents:
42260
diff
changeset
|
302 |
comp.compile(args.getFileObjects(), args.getClassNames(), null, List.nil()); |
10 | 303 |
|
1866 | 304 |
if (log.expectDiagKeys != null) { |
7335
8b390fd27190
6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents:
6721
diff
changeset
|
305 |
if (log.expectDiagKeys.isEmpty()) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
306 |
log.printRawLines("all expected diagnostics found"); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
307 |
return Result.OK; |
1866 | 308 |
} else { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
309 |
log.printRawLines("expected diagnostic keys not found: " + log.expectDiagKeys); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
310 |
return Result.ERROR; |
1866 | 311 |
} |
312 |
} |
|
313 |
||
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
314 |
return (comp.errorCount() == 0) ? Result.OK : Result.ERROR; |
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
315 |
|
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
316 |
} catch (OutOfMemoryError | StackOverflowError ex) { |
10 | 317 |
resourceMessage(ex); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
318 |
return Result.SYSERR; |
10 | 319 |
} catch (FatalError ex) { |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
320 |
feMessage(ex, options); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
321 |
return Result.SYSERR; |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
322 |
} catch (AnnotationProcessingError ex) { |
10 | 323 |
apMessage(ex); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
324 |
return Result.SYSERR; |
10 | 325 |
} catch (PropagatedException ex) { |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
326 |
// TODO: what about errors from plugins? should not simply rethrow the error here |
10 | 327 |
throw ex.getCause(); |
328 |
} catch (Throwable ex) { |
|
329 |
// Nasty. If we've already reported an error, compensate |
|
330 |
// for buggy compiler error recovery by swallowing thrown |
|
331 |
// exceptions. |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
332 |
if (comp == null || comp.errorCount() == 0 || options.isSet("dev")) |
10 | 333 |
bugMessage(ex); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
334 |
return Result.ABNORMAL; |
10 | 335 |
} finally { |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
336 |
if (comp != null) { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
337 |
try { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
338 |
comp.close(); |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
339 |
} catch (ClientCodeException ex) { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
340 |
throw new RuntimeException(ex.getCause()); |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
341 |
} |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
342 |
} |
10 | 343 |
} |
344 |
} |
|
345 |
||
346 |
/** Print a message reporting an internal error. |
|
347 |
*/ |
|
348 |
void bugMessage(Throwable ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
349 |
log.printLines(PrefixKind.JAVAC, "msg.bug", JavaCompiler.version()); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
350 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 351 |
} |
352 |
||
6581 | 353 |
/** Print a message reporting a fatal error. |
10 | 354 |
*/ |
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
355 |
void feMessage(Throwable ex, Options options) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
356 |
log.printRawLines(ex.getMessage()); |
6721 | 357 |
if (ex.getCause() != null && options.isSet("dev")) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
358 |
ex.getCause().printStackTrace(log.getWriter(WriterKind.NOTICE)); |
6581 | 359 |
} |
10 | 360 |
} |
361 |
||
362 |
/** Print a message reporting an input/output error. |
|
363 |
*/ |
|
364 |
void ioMessage(Throwable ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
365 |
log.printLines(PrefixKind.JAVAC, "msg.io"); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
366 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 367 |
} |
368 |
||
369 |
/** Print a message reporting an out-of-resources error. |
|
370 |
*/ |
|
371 |
void resourceMessage(Throwable ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
372 |
log.printLines(PrefixKind.JAVAC, "msg.resource"); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
373 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 374 |
} |
375 |
||
376 |
/** Print a message reporting an uncaught exception from an |
|
377 |
* annotation processor. |
|
378 |
*/ |
|
379 |
void apMessage(AnnotationProcessingError ex) { |
|
14448 | 380 |
log.printLines(PrefixKind.JAVAC, "msg.proc.annotation.uncaught.exception"); |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
381 |
ex.getCause().printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 382 |
} |
383 |
||
14548
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
384 |
/** Print a message reporting an uncaught exception from an |
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
385 |
* annotation processor. |
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
386 |
*/ |
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
387 |
void pluginMessage(Throwable ex) { |
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
388 |
log.printLines(PrefixKind.JAVAC, "msg.plugin.uncaught.exception"); |
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
389 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
390 |
} |
aa687b312c97
8001098: Provide a simple light-weight "plug-in" mechanism for javac
jjg
parents:
14448
diff
changeset
|
391 |
|
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
392 |
/** Display the location and checksum of a class. */ |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
393 |
void showClass(String className) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
394 |
PrintWriter pw = log.getWriter(WriterKind.NOTICE); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
395 |
pw.println("javac: show class: " + className); |
36526 | 396 |
|
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
397 |
URL url = getClass().getResource('/' + className.replace('.', '/') + ".class"); |
36526 | 398 |
if (url != null) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
399 |
pw.println(" " + url); |
36526 | 400 |
} |
401 |
||
402 |
try (InputStream in = getClass().getResourceAsStream('/' + className.replace('.', '/') + ".class")) { |
|
403 |
final String algorithm = "MD5"; |
|
404 |
byte[] digest; |
|
405 |
MessageDigest md = MessageDigest.getInstance(algorithm); |
|
406 |
try (DigestInputStream din = new DigestInputStream(in, md)) { |
|
407 |
byte[] buf = new byte[8192]; |
|
408 |
int n; |
|
409 |
do { n = din.read(buf); } while (n > 0); |
|
410 |
digest = md.digest(); |
|
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
411 |
} |
36526 | 412 |
StringBuilder sb = new StringBuilder(); |
413 |
for (byte b: digest) |
|
414 |
sb.append(String.format("%02x", b)); |
|
415 |
pw.println(" " + algorithm + " checksum: " + sb); |
|
416 |
} catch (NoSuchAlgorithmException | IOException e) { |
|
417 |
pw.println(" cannot compute digest: " + e); |
|
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
418 |
} |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
419 |
} |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
420 |
|
26264
a09fedde76be
8044859: javac duplicates option processing when using Compiler API
jjg
parents:
25874
diff
changeset
|
421 |
// TODO: update this to JavacFileManager |
10 | 422 |
private JavaFileManager fileManager; |
423 |
||
424 |
/* ************************************************************************ |
|
425 |
* Internationalization |
|
426 |
*************************************************************************/ |
|
427 |
||
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
428 |
public static final String javacBundleName = |
10 | 429 |
"com.sun.tools.javac.resources.javac"; |
430 |
} |