232 } |
234 } |
233 } |
235 } |
234 |
236 |
235 void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { |
237 void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { |
236 JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, |
238 JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, |
237 Arrays.asList("-XDallowLambda"), null, Arrays.asList(source)); |
239 null, null, Arrays.asList(source)); |
238 try { |
240 try { |
239 ct.parse(); |
241 ct.parse(); |
240 } catch (Throwable ex) { |
242 } catch (Throwable ex) { |
241 throw new AssertionError("Error thrown when parsing the following source:\n" + source.getCharContent(true)); |
243 throw new AssertionError("Error thrown when parsing the following source:\n" + source.getCharContent(true)); |
242 } |
244 } |