285 @Override |
285 @Override |
286 public void run() { |
286 public void run() { |
287 final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); |
287 final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); |
288 |
288 |
289 JavacTask ct = (JavacTask)tool.getTask(null, fm.get(), diagChecker, |
289 JavacTask ct = (JavacTask)tool.getTask(null, fm.get(), diagChecker, |
290 Arrays.asList("-XDallowIntersectionTypes"), |
290 null, null, Arrays.asList(source)); |
291 null, Arrays.asList(source)); |
|
292 try { |
291 try { |
293 ct.analyze(); |
292 ct.analyze(); |
294 } catch (Throwable ex) { |
293 } catch (Throwable ex) { |
295 throw new AssertionError("Error thrown when compiling the following code:\n" + |
294 throw new AssertionError("Error thrown when compiling the following code:\n" + |
296 source.getCharContent(true)); |
295 source.getCharContent(true)); |