test/tools/javac/lambda/MethodReferenceParserTest.java

changeset 1415
01c9d4161882
parent 1352
d4b3cb1ece84
child 1482
954541f13717
equal deleted inserted replaced
1414:843d3b191773 1415:01c9d4161882
22 */ 22 */
23 23
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 7115052 26 * @bug 7115052
27 * @summary Add parser support for method references 27 * @bug 8003280
28 * @summary Add lambda tests
29 * Add parser support for method references
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;
225 } 227 }
226 } 228 }
227 229
228 void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { 230 void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
229 JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, 231 JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
230 Arrays.asList("-XDallowMethodReferences"), null, Arrays.asList(source)); 232 null, null, Arrays.asList(source));
231 try { 233 try {
232 ct.parse(); 234 ct.parse();
233 } catch (Throwable ex) { 235 } catch (Throwable ex) {
234 throw new AssertionError("Error thrown when parsing the following source:\n" + source.getCharContent(true)); 236 throw new AssertionError("Error thrown when parsing the following source:\n" + source.getCharContent(true));
235 } 237 }

mercurial