156 if (used.getAndSet(true)) { |
156 if (used.getAndSet(true)) { |
157 if (compiler == null) |
157 if (compiler == null) |
158 throw new IllegalStateException(); |
158 throw new IllegalStateException(); |
159 } else { |
159 } else { |
160 initContext(); |
160 initContext(); |
|
161 compilerMain.log = Log.instance(context); |
161 compilerMain.setOptions(Options.instance(context)); |
162 compilerMain.setOptions(Options.instance(context)); |
162 compilerMain.filenames = new LinkedHashSet<File>(); |
163 compilerMain.filenames = new LinkedHashSet<File>(); |
163 Collection<File> filenames = compilerMain.processArgs(CommandLine.parse(args), classNames); |
164 Collection<File> filenames = compilerMain.processArgs(CommandLine.parse(args), classNames); |
164 if (!filenames.isEmpty()) |
165 if (filenames != null && !filenames.isEmpty()) |
165 throw new IllegalArgumentException("Malformed arguments " + toString(filenames, " ")); |
166 throw new IllegalArgumentException("Malformed arguments " + toString(filenames, " ")); |
166 compiler = JavaCompiler.instance(context); |
167 compiler = JavaCompiler.instance(context); |
167 compiler.keepComments = true; |
168 compiler.keepComments = true; |
168 compiler.genEndPos = true; |
169 compiler.genEndPos = true; |
169 // NOTE: this value will be updated after annotation processing |
170 // NOTE: this value will be updated after annotation processing |