test/tools/javac/lambda/LambdaParserTest.java

changeset 1415
01c9d4161882
parent 1169
116f68a5e677
child 1436
f6f1fd261f57
equal deleted inserted replaced
1414:843d3b191773 1415:01c9d4161882
22 */ 22 */
23 23
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 7115050 26 * @bug 7115050
27 * @summary Add parser support for lambda expressions 27 * @bug 8003280
28 * @summary Add lambda tests
29 * Add parser support for lambda expressions
28 */ 30 */
29 31
30 import com.sun.source.util.JavacTask; 32 import com.sun.source.util.JavacTask;
31 import java.net.URI; 33 import java.net.URI;
32 import java.util.Arrays; 34 import java.util.Arrays;
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 }

mercurial