author | jjh |
Sat, 19 Nov 2011 15:54:04 -0800 | |
changeset 11057 | 14b0b1e3dd43 |
parent 11053 | 48713f779b1d |
child 11314 | b612aaca08d0 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
8623
cc57bd7697a2
6986895: compiler gives misleading message for no input files
jjg
parents:
8036
diff
changeset
|
2 |
* Copyright (c) 1999, 2011, 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 |
||
28 |
import java.io.File; |
|
29 |
import java.io.IOException; |
|
30 |
import java.io.PrintWriter; |
|
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
31 |
import java.net.URL; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
32 |
import java.security.DigestInputStream; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
33 |
import java.security.MessageDigest; |
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
34 |
import java.util.Collection; |
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
35 |
import java.util.LinkedHashSet; |
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
36 |
import java.util.Set; |
6721 | 37 |
import javax.tools.JavaFileManager; |
38 |
import javax.tools.JavaFileObject; |
|
39 |
import javax.annotation.processing.Processor; |
|
10 | 40 |
|
41 |
import com.sun.tools.javac.code.Source; |
|
1208 | 42 |
import com.sun.tools.javac.file.CacheFSInfo; |
731
1dd22bdb9ca5
6714364: refactor javac File handling code into new javac.file package
jjg
parents:
10
diff
changeset
|
43 |
import com.sun.tools.javac.file.JavacFileManager; |
10 | 44 |
import com.sun.tools.javac.jvm.Target; |
45 |
import com.sun.tools.javac.main.JavacOption.Option; |
|
46 |
import com.sun.tools.javac.main.RecognizedOptions.OptionHelper; |
|
47 |
import com.sun.tools.javac.util.*; |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
48 |
import com.sun.tools.javac.util.Log.WriterKind; |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
49 |
import com.sun.tools.javac.util.Log.PrefixKind; |
10 | 50 |
import com.sun.tools.javac.processing.AnnotationProcessingError; |
6721 | 51 |
|
52 |
import static com.sun.tools.javac.main.OptionName.*; |
|
10 | 53 |
|
54 |
/** This class provides a commandline interface to the GJC compiler. |
|
55 |
* |
|
5847
1908176fd6e3
6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
56 |
* <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
|
57 |
* If you write code that depends on this, you do so at your own risk. |
10 | 58 |
* This code and its internal interfaces are subject to change or |
59 |
* deletion without notice.</b> |
|
60 |
*/ |
|
61 |
public class Main { |
|
62 |
||
63 |
/** The name of the compiler, for use in diagnostics. |
|
64 |
*/ |
|
65 |
String ownName; |
|
66 |
||
67 |
/** The writer to use for diagnostic output. |
|
68 |
*/ |
|
69 |
PrintWriter out; |
|
70 |
||
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
71 |
/** The log to use for diagnostic output. |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
72 |
*/ |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
73 |
Log log; |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
74 |
|
10 | 75 |
/** |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
76 |
* 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
|
77 |
* arg errors, or exceptions in user provided code. |
10 | 78 |
*/ |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
79 |
boolean apiMode; |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
80 |
|
10 | 81 |
|
82 |
/** Result codes. |
|
83 |
*/ |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
84 |
public enum Result { |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
85 |
OK(0), // Compilation completed with no errors. |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
86 |
ERROR(1), // Completed but reported errors. |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
87 |
CMDERR(2), // Bad command-line arguments |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
88 |
SYSERR(3), // System error or resource exhaustion. |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
89 |
ABNORMAL(4); // Compiler terminated abnormally |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
90 |
|
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
91 |
Result(int exitCode) { |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
92 |
this.exitCode = exitCode; |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
93 |
} |
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 |
public boolean isOK() { |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
96 |
return (exitCode == 0); |
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 final int exitCode; |
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
100 |
} |
10 | 101 |
|
102 |
private Option[] recognizedOptions = RecognizedOptions.getJavaCompilerOptions(new OptionHelper() { |
|
103 |
||
104 |
public void setOut(PrintWriter out) { |
|
105 |
Main.this.out = out; |
|
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
106 |
Main.this.log.setWriters(out); |
10 | 107 |
} |
108 |
||
109 |
public void error(String key, Object... args) { |
|
110 |
Main.this.error(key, args); |
|
111 |
} |
|
112 |
||
113 |
public void printVersion() { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
114 |
log.printLines(PrefixKind.JAVAC, "version", ownName, JavaCompiler.version()); |
10 | 115 |
} |
116 |
||
117 |
public void printFullVersion() { |
|
11057
14b0b1e3dd43
7110611: compiler message file broken for javac -fullversion
jjh
parents:
11053
diff
changeset
|
118 |
log.printLines(PrefixKind.JAVAC, "fullVersion", ownName, JavaCompiler.fullVersion()); |
10 | 119 |
} |
120 |
||
121 |
public void printHelp() { |
|
122 |
help(); |
|
123 |
} |
|
124 |
||
125 |
public void printXhelp() { |
|
126 |
xhelp(); |
|
127 |
} |
|
128 |
||
129 |
public void addFile(File f) { |
|
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
130 |
filenames.add(f); |
10 | 131 |
} |
132 |
||
133 |
public void addClassName(String s) { |
|
134 |
classnames.append(s); |
|
135 |
} |
|
136 |
||
137 |
}); |
|
138 |
||
139 |
/** |
|
140 |
* Construct a compiler instance. |
|
141 |
*/ |
|
142 |
public Main(String name) { |
|
143 |
this(name, new PrintWriter(System.err, true)); |
|
144 |
} |
|
145 |
||
146 |
/** |
|
147 |
* Construct a compiler instance. |
|
148 |
*/ |
|
149 |
public Main(String name, PrintWriter out) { |
|
150 |
this.ownName = name; |
|
151 |
this.out = out; |
|
152 |
} |
|
153 |
/** A table of all options that's passed to the JavaCompiler constructor. */ |
|
154 |
private Options options = null; |
|
155 |
||
156 |
/** The list of source files to process |
|
157 |
*/ |
|
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
158 |
public Set<File> filenames = null; // XXX sb protected |
10 | 159 |
|
160 |
/** List of class files names passed on the command line |
|
161 |
*/ |
|
162 |
public ListBuffer<String> classnames = null; // XXX sb protected |
|
163 |
||
164 |
/** Print a string that explains usage. |
|
165 |
*/ |
|
166 |
void help() { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
167 |
log.printLines(PrefixKind.JAVAC, "msg.usage.header", ownName); |
10 | 168 |
for (int i=0; i<recognizedOptions.length; i++) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
169 |
recognizedOptions[i].help(log); |
10 | 170 |
} |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
171 |
log.printNewline(); |
10 | 172 |
} |
173 |
||
174 |
/** Print a string that explains usage for X options. |
|
175 |
*/ |
|
176 |
void xhelp() { |
|
177 |
for (int i=0; i<recognizedOptions.length; i++) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
178 |
recognizedOptions[i].xhelp(log); |
10 | 179 |
} |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
180 |
log.printNewline(); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
181 |
log.printLines(PrefixKind.JAVAC, "msg.usage.nonstandard.footer"); |
10 | 182 |
} |
183 |
||
184 |
/** Report a usage error. |
|
185 |
*/ |
|
186 |
void error(String key, Object... args) { |
|
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
187 |
if (apiMode) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
188 |
String msg = log.localize(PrefixKind.JAVAC, key, args); |
10 | 189 |
throw new PropagatedException(new IllegalStateException(msg)); |
190 |
} |
|
191 |
warning(key, args); |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
192 |
log.printLines(PrefixKind.JAVAC, "msg.usage", ownName); |
10 | 193 |
} |
194 |
||
195 |
/** Report a warning. |
|
196 |
*/ |
|
197 |
void warning(String key, Object... args) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
198 |
log.printRawLines(ownName + ": " + log.localize(PrefixKind.JAVAC, key, args)); |
10 | 199 |
} |
200 |
||
201 |
public Option getOption(String flag) { |
|
202 |
for (Option option : recognizedOptions) { |
|
203 |
if (option.matches(flag)) |
|
204 |
return option; |
|
205 |
} |
|
206 |
return null; |
|
207 |
} |
|
208 |
||
209 |
public void setOptions(Options options) { |
|
210 |
if (options == null) |
|
211 |
throw new NullPointerException(); |
|
212 |
this.options = options; |
|
213 |
} |
|
214 |
||
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
215 |
public void setAPIMode(boolean apiMode) { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
216 |
this.apiMode = apiMode; |
10 | 217 |
} |
218 |
||
219 |
/** Process command line arguments: store all command line options |
|
220 |
* in `options' table and return all source filenames. |
|
221 |
* @param flags The array of command line arguments. |
|
222 |
*/ |
|
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
223 |
public Collection<File> processArgs(String[] flags) { // XXX sb protected |
10 | 224 |
int ac = 0; |
225 |
while (ac < flags.length) { |
|
226 |
String flag = flags[ac]; |
|
227 |
ac++; |
|
228 |
||
229 |
Option option = null; |
|
230 |
||
231 |
if (flag.length() > 0) { |
|
232 |
// quick hack to speed up file processing: |
|
233 |
// if the option does not begin with '-', there is no need to check |
|
234 |
// most of the compiler options. |
|
235 |
int firstOptionToCheck = flag.charAt(0) == '-' ? 0 : recognizedOptions.length-1; |
|
236 |
for (int j=firstOptionToCheck; j<recognizedOptions.length; j++) { |
|
237 |
if (recognizedOptions[j].matches(flag)) { |
|
238 |
option = recognizedOptions[j]; |
|
239 |
break; |
|
240 |
} |
|
241 |
} |
|
242 |
} |
|
243 |
||
244 |
if (option == null) { |
|
245 |
error("err.invalid.flag", flag); |
|
246 |
return null; |
|
247 |
} |
|
248 |
||
249 |
if (option.hasArg()) { |
|
250 |
if (ac == flags.length) { |
|
251 |
error("err.req.arg", flag); |
|
252 |
return null; |
|
253 |
} |
|
254 |
String operand = flags[ac]; |
|
255 |
ac++; |
|
256 |
if (option.process(options, flag, operand)) |
|
257 |
return null; |
|
258 |
} else { |
|
259 |
if (option.process(options, flag)) |
|
260 |
return null; |
|
261 |
} |
|
262 |
} |
|
263 |
||
6721 | 264 |
if (!checkDirectory(D)) |
10 | 265 |
return null; |
6721 | 266 |
if (!checkDirectory(S)) |
10 | 267 |
return null; |
268 |
||
6721 | 269 |
String sourceString = options.get(SOURCE); |
10 | 270 |
Source source = (sourceString != null) |
271 |
? Source.lookup(sourceString) |
|
272 |
: Source.DEFAULT; |
|
6721 | 273 |
String targetString = options.get(TARGET); |
10 | 274 |
Target target = (targetString != null) |
275 |
? Target.lookup(targetString) |
|
276 |
: Target.DEFAULT; |
|
277 |
// We don't check source/target consistency for CLDC, as J2ME |
|
278 |
// profiles are not aligned with J2SE targets; moreover, a |
|
279 |
// single CLDC target may have many profiles. In addition, |
|
280 |
// this is needed for the continued functioning of the JSR14 |
|
281 |
// prototype. |
|
282 |
if (Character.isDigit(target.name.charAt(0))) { |
|
283 |
if (target.compareTo(source.requiredTarget()) < 0) { |
|
284 |
if (targetString != null) { |
|
285 |
if (sourceString == null) { |
|
286 |
warning("warn.target.default.source.conflict", |
|
287 |
targetString, |
|
288 |
source.requiredTarget().name); |
|
289 |
} else { |
|
290 |
warning("warn.source.target.conflict", |
|
291 |
sourceString, |
|
292 |
source.requiredTarget().name); |
|
293 |
} |
|
294 |
return null; |
|
295 |
} else { |
|
2723
b659ca23d5f5
6829189: Java programming with JSR 292 needs language support
jrose
parents:
2212
diff
changeset
|
296 |
target = source.requiredTarget(); |
b659ca23d5f5
6829189: Java programming with JSR 292 needs language support
jrose
parents:
2212
diff
changeset
|
297 |
options.put("-target", target.name); |
10 | 298 |
} |
299 |
} else { |
|
300 |
if (targetString == null && !source.allowGenerics()) { |
|
2723
b659ca23d5f5
6829189: Java programming with JSR 292 needs language support
jrose
parents:
2212
diff
changeset
|
301 |
target = Target.JDK1_4; |
b659ca23d5f5
6829189: Java programming with JSR 292 needs language support
jrose
parents:
2212
diff
changeset
|
302 |
options.put("-target", target.name); |
10 | 303 |
} |
304 |
} |
|
305 |
} |
|
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
306 |
|
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
307 |
// handle this here so it works even if no other options given |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
308 |
String showClass = options.get("showClass"); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
309 |
if (showClass != null) { |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
310 |
if (showClass.equals("showClass")) // no value given for option |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
311 |
showClass = "com.sun.tools.javac.Main"; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
312 |
showClass(showClass); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
313 |
} |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
314 |
|
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
315 |
options.notifyListeners(); |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
316 |
|
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
317 |
return filenames; |
10 | 318 |
} |
319 |
// where |
|
6721 | 320 |
private boolean checkDirectory(OptionName optName) { |
10 | 321 |
String value = options.get(optName); |
322 |
if (value == null) |
|
323 |
return true; |
|
324 |
File file = new File(value); |
|
325 |
if (!file.exists()) { |
|
326 |
error("err.dir.not.found", value); |
|
327 |
return false; |
|
328 |
} |
|
329 |
if (!file.isDirectory()) { |
|
330 |
error("err.file.not.directory", value); |
|
331 |
return false; |
|
332 |
} |
|
333 |
return true; |
|
334 |
} |
|
335 |
||
336 |
/** Programmatic interface for main function. |
|
337 |
* @param args The command line parameters. |
|
338 |
*/ |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
339 |
public Result compile(String[] args) { |
10 | 340 |
Context context = new Context(); |
341 |
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
|
342 |
Result result = compile(args, context); |
10 | 343 |
if (fileManager instanceof JavacFileManager) { |
344 |
// A fresh context was created above, so jfm must be a JavacFileManager |
|
345 |
((JavacFileManager)fileManager).close(); |
|
346 |
} |
|
347 |
return result; |
|
348 |
} |
|
349 |
||
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
350 |
public Result compile(String[] args, Context context) { |
10 | 351 |
return compile(args, context, List.<JavaFileObject>nil(), null); |
352 |
} |
|
353 |
||
354 |
/** Programmatic interface for main function. |
|
355 |
* @param args The command line parameters. |
|
356 |
*/ |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
357 |
public Result compile(String[] args, |
10 | 358 |
Context context, |
359 |
List<JavaFileObject> fileObjects, |
|
360 |
Iterable<? extends Processor> processors) |
|
361 |
{ |
|
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
362 |
context.put(Log.outKey, out); |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
363 |
log = Log.instance(context); |
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
364 |
|
10 | 365 |
if (options == null) |
366 |
options = Options.instance(context); // creates a new one |
|
367 |
||
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
368 |
filenames = new LinkedHashSet<File>(); |
10 | 369 |
classnames = new ListBuffer<String>(); |
370 |
JavaCompiler comp = null; |
|
371 |
/* |
|
372 |
* TODO: Logic below about what is an acceptable command line |
|
373 |
* should be updated to take annotation processing semantics |
|
374 |
* into account. |
|
375 |
*/ |
|
376 |
try { |
|
377 |
if (args.length == 0 && fileObjects.isEmpty()) { |
|
378 |
help(); |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
379 |
return Result.CMDERR; |
10 | 380 |
} |
381 |
||
10193
3e1ef5e9f4fd
7061125: Proposed javac argument processing performance improvement
jjg
parents:
9071
diff
changeset
|
382 |
Collection<File> files; |
10 | 383 |
try { |
1866 | 384 |
files = processArgs(CommandLine.parse(args)); |
385 |
if (files == null) { |
|
10 | 386 |
// null signals an error in options, abort |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
387 |
return Result.CMDERR; |
1866 | 388 |
} else if (files.isEmpty() && fileObjects.isEmpty() && classnames.isEmpty()) { |
10 | 389 |
// it is allowed to compile nothing if just asking for help or version info |
6721 | 390 |
if (options.isSet(HELP) |
391 |
|| options.isSet(X) |
|
392 |
|| options.isSet(VERSION) |
|
393 |
|| options.isSet(FULLVERSION)) |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
394 |
return Result.OK; |
8623
cc57bd7697a2
6986895: compiler gives misleading message for no input files
jjg
parents:
8036
diff
changeset
|
395 |
if (JavaCompiler.explicitAnnotationProcessingRequested(options)) { |
cc57bd7697a2
6986895: compiler gives misleading message for no input files
jjg
parents:
8036
diff
changeset
|
396 |
error("err.no.source.files.classes"); |
cc57bd7697a2
6986895: compiler gives misleading message for no input files
jjg
parents:
8036
diff
changeset
|
397 |
} else { |
cc57bd7697a2
6986895: compiler gives misleading message for no input files
jjg
parents:
8036
diff
changeset
|
398 |
error("err.no.source.files"); |
cc57bd7697a2
6986895: compiler gives misleading message for no input files
jjg
parents:
8036
diff
changeset
|
399 |
} |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
400 |
return Result.CMDERR; |
10 | 401 |
} |
402 |
} catch (java.io.FileNotFoundException e) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
403 |
warning("err.file.not.found", e.getMessage()); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
404 |
return Result.SYSERR; |
10 | 405 |
} |
406 |
||
6721 | 407 |
boolean forceStdOut = options.isSet("stdout"); |
10 | 408 |
if (forceStdOut) { |
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
409 |
log.flush(); |
10 | 410 |
out = new PrintWriter(System.out, true); |
11052
65b9fa7eaf55
7108668: allow Log to be initialized and used earlier
jjg
parents:
10638
diff
changeset
|
411 |
log.setWriters(out); |
10 | 412 |
} |
413 |
||
1208 | 414 |
// allow System property in following line as a Mustang legacy |
6721 | 415 |
boolean batchMode = (options.isUnset("nonBatchMode") |
1208 | 416 |
&& System.getProperty("nonBatchMode") == null); |
417 |
if (batchMode) |
|
418 |
CacheFSInfo.preRegister(context); |
|
419 |
||
10 | 420 |
fileManager = context.get(JavaFileManager.class); |
421 |
||
422 |
comp = JavaCompiler.instance(context); |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
423 |
if (comp == null) return Result.SYSERR; |
10 | 424 |
|
1866 | 425 |
if (!files.isEmpty()) { |
10 | 426 |
// add filenames to fileObjects |
427 |
comp = JavaCompiler.instance(context); |
|
428 |
List<JavaFileObject> otherFiles = List.nil(); |
|
429 |
JavacFileManager dfm = (JavacFileManager)fileManager; |
|
1866 | 430 |
for (JavaFileObject fo : dfm.getJavaFileObjectsFromFiles(files)) |
10 | 431 |
otherFiles = otherFiles.prepend(fo); |
432 |
for (JavaFileObject fo : otherFiles) |
|
433 |
fileObjects = fileObjects.prepend(fo); |
|
434 |
} |
|
435 |
comp.compile(fileObjects, |
|
436 |
classnames.toList(), |
|
437 |
processors); |
|
438 |
||
1866 | 439 |
if (log.expectDiagKeys != null) { |
7335
8b390fd27190
6900037: javac should warn if earlier -source is used and bootclasspath not set
jjg
parents:
6721
diff
changeset
|
440 |
if (log.expectDiagKeys.isEmpty()) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
441 |
log.printRawLines("all expected diagnostics found"); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
442 |
return Result.OK; |
1866 | 443 |
} else { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
444 |
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
|
445 |
return Result.ERROR; |
1866 | 446 |
} |
447 |
} |
|
448 |
||
1996 | 449 |
if (comp.errorCount() != 0) |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
450 |
return Result.ERROR; |
10 | 451 |
} catch (IOException ex) { |
452 |
ioMessage(ex); |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
453 |
return Result.SYSERR; |
10 | 454 |
} catch (OutOfMemoryError ex) { |
455 |
resourceMessage(ex); |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
456 |
return Result.SYSERR; |
10 | 457 |
} catch (StackOverflowError ex) { |
458 |
resourceMessage(ex); |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
459 |
return Result.SYSERR; |
10 | 460 |
} catch (FatalError ex) { |
461 |
feMessage(ex); |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
462 |
return Result.SYSERR; |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
463 |
} catch (AnnotationProcessingError ex) { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
464 |
if (apiMode) |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
465 |
throw new RuntimeException(ex.getCause()); |
10 | 466 |
apMessage(ex); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
467 |
return Result.SYSERR; |
10 | 468 |
} catch (ClientCodeException ex) { |
469 |
// as specified by javax.tools.JavaCompiler#getTask |
|
470 |
// and javax.tools.JavaCompiler.CompilationTask#call |
|
471 |
throw new RuntimeException(ex.getCause()); |
|
472 |
} catch (PropagatedException ex) { |
|
473 |
throw ex.getCause(); |
|
474 |
} catch (Throwable ex) { |
|
475 |
// Nasty. If we've already reported an error, compensate |
|
476 |
// for buggy compiler error recovery by swallowing thrown |
|
477 |
// exceptions. |
|
478 |
if (comp == null || comp.errorCount() == 0 || |
|
6721 | 479 |
options == null || options.isSet("dev")) |
10 | 480 |
bugMessage(ex); |
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
481 |
return Result.ABNORMAL; |
10 | 482 |
} finally { |
9071
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
483 |
if (comp != null) { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
484 |
try { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
485 |
comp.close(); |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
486 |
} catch (ClientCodeException ex) { |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
487 |
throw new RuntimeException(ex.getCause()); |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
488 |
} |
88cd61b4e5aa
6437138: JSR 199: Compiler doesn't diagnose crash in user code
jjg
parents:
8623
diff
changeset
|
489 |
} |
10 | 490 |
filenames = null; |
491 |
options = null; |
|
492 |
} |
|
10638
c8e9604cf151
7075721: javac should have public enum for exit codes
jjg
parents:
10193
diff
changeset
|
493 |
return Result.OK; |
10 | 494 |
} |
495 |
||
496 |
/** Print a message reporting an internal error. |
|
497 |
*/ |
|
498 |
void bugMessage(Throwable ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
499 |
log.printLines(PrefixKind.JAVAC, "msg.bug", JavaCompiler.version()); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
500 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 501 |
} |
502 |
||
6581 | 503 |
/** Print a message reporting a fatal error. |
10 | 504 |
*/ |
505 |
void feMessage(Throwable ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
506 |
log.printRawLines(ex.getMessage()); |
6721 | 507 |
if (ex.getCause() != null && options.isSet("dev")) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
508 |
ex.getCause().printStackTrace(log.getWriter(WriterKind.NOTICE)); |
6581 | 509 |
} |
10 | 510 |
} |
511 |
||
512 |
/** Print a message reporting an input/output error. |
|
513 |
*/ |
|
514 |
void ioMessage(Throwable ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
515 |
log.printLines(PrefixKind.JAVAC, "msg.io"); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
516 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 517 |
} |
518 |
||
519 |
/** Print a message reporting an out-of-resources error. |
|
520 |
*/ |
|
521 |
void resourceMessage(Throwable ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
522 |
log.printLines(PrefixKind.JAVAC, "msg.resource"); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
523 |
ex.printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 524 |
} |
525 |
||
526 |
/** Print a message reporting an uncaught exception from an |
|
527 |
* annotation processor. |
|
528 |
*/ |
|
529 |
void apMessage(AnnotationProcessingError ex) { |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
530 |
log.printLines("msg.proc.annotation.uncaught.exception"); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
531 |
ex.getCause().printStackTrace(log.getWriter(WriterKind.NOTICE)); |
10 | 532 |
} |
533 |
||
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
534 |
/** 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
|
535 |
void showClass(String className) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
536 |
PrintWriter pw = log.getWriter(WriterKind.NOTICE); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
537 |
pw.println("javac: show class: " + className); |
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
538 |
URL url = getClass().getResource('/' + className.replace('.', '/') + ".class"); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
539 |
if (url == null) |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
540 |
pw.println(" class not found"); |
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
541 |
else { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
542 |
pw.println(" " + url); |
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
543 |
try { |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
544 |
final String algorithm = "MD5"; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
545 |
byte[] digest; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
546 |
MessageDigest md = MessageDigest.getInstance(algorithm); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
547 |
DigestInputStream in = new DigestInputStream(url.openStream(), md); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
548 |
try { |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
549 |
byte[] buf = new byte[8192]; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
550 |
int n; |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
551 |
do { n = in.read(buf); } while (n > 0); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
552 |
digest = md.digest(); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
553 |
} finally { |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
554 |
in.close(); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
555 |
} |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
556 |
StringBuilder sb = new StringBuilder(); |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
557 |
for (byte b: digest) |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
558 |
sb.append(String.format("%02x", b)); |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
559 |
pw.println(" " + algorithm + " checksum: " + sb); |
5319
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
560 |
} catch (Exception e) { |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
561 |
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
|
562 |
} |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
563 |
} |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
564 |
} |
63dc7f367a37
6942649: add hidden option to identify location and version of javac classes
jjg
parents:
2723
diff
changeset
|
565 |
|
10 | 566 |
private JavaFileManager fileManager; |
567 |
||
568 |
/* ************************************************************************ |
|
569 |
* Internationalization |
|
570 |
*************************************************************************/ |
|
571 |
||
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
572 |
// /** Find a localized string in the resource bundle. |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
573 |
// * @param key The key for the localized string. |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
574 |
// */ |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
575 |
// public static String getLocalizedString(String key, Object... args) { // FIXME sb private |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
576 |
// try { |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
577 |
// if (messages == null) |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
578 |
// messages = new JavacMessages(javacBundleName); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
579 |
// return messages.getLocalizedString("javac." + key, args); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
580 |
// } |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
581 |
// catch (MissingResourceException e) { |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
582 |
// throw new Error("Fatal Error: Resource for javac is missing", e); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
583 |
// } |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
584 |
// } |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
585 |
// |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
586 |
// public static void useRawMessages(boolean enable) { |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
587 |
// if (enable) { |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
588 |
// messages = new JavacMessages(javacBundleName) { |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
589 |
// @Override |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
590 |
// public String getLocalizedString(String key, Object... args) { |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
591 |
// return key; |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
592 |
// } |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
593 |
// }; |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
594 |
// } else { |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
595 |
// messages = new JavacMessages(javacBundleName); |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
596 |
// } |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
597 |
// } |
10 | 598 |
|
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
599 |
public static final String javacBundleName = |
10 | 600 |
"com.sun.tools.javac.resources.javac"; |
11053
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
601 |
// |
48713f779b1d
7108669: cleanup Log methods for direct printing to streams
jjg
parents:
11052
diff
changeset
|
602 |
// private static JavacMessages messages; |
10 | 603 |
} |