test/tools/javac/cast/intersection/IntersectionTypeCastTest.java

changeset 1511
c7c41a044e7c
parent 1482
954541f13717
child 1520
5c956be64b9e
equal deleted inserted replaced
1510:7873d37f5b37 1511:c7c41a044e7c
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));

mercurial