equal
deleted
inserted
replaced
250 " }\n" + |
250 " }\n" + |
251 "}"; |
251 "}"; |
252 |
252 |
253 @Override |
253 @Override |
254 public void doWork() throws IOException { |
254 public void doWork() throws IOException { |
255 ComboTask comboTask = newCompilationTask() |
255 newCompilationTask() |
256 .withOption("-g") |
256 .withOption("-g") |
257 .withSourceFromTemplate(source_template); |
257 .withSourceFromTemplate(source_template) |
258 |
258 .withListenerFactory(context -> { |
259 JavacTaskImpl ct = (JavacTaskImpl)comboTask.getTask(); |
259 Symtab syms = Symtab.instance(context); |
260 Context context = ct.getContext(); |
260 Names names = Names.instance(context); |
261 Symtab syms = Symtab.instance(context); |
261 Types types = Types.instance(context); |
262 Names names = Names.instance(context); |
262 return new Indifier(syms, names, types); |
263 Types types = Types.instance(context); |
263 }) |
264 ct.addTaskListener(new Indifier(syms, names, types)); |
264 .generate(this::verifyBytecode); |
265 verifyBytecode(comboTask.generate()); |
|
266 } |
265 } |
267 |
266 |
268 void verifyBytecode(Result<Iterable<? extends JavaFileObject>> res) { |
267 void verifyBytecode(Result<Iterable<? extends JavaFileObject>> res) { |
269 if (res.hasErrors()) { |
268 if (res.hasErrors()) { |
270 fail("Diags found when compiling instance: " + res.compilationInfo()); |
269 fail("Diags found when compiling instance: " + res.compilationInfo()); |