diff -r 7993cfab8610 -r 4a6acc42c3a1 test/tools/javac/lambda/MethodReference41.java --- a/test/tools/javac/lambda/MethodReference41.java Fri Aug 30 17:36:47 2013 -0700 +++ b/test/tools/javac/lambda/MethodReference41.java Mon Sep 02 22:38:36 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,18 +26,10 @@ * @bug 8003280 * @summary Add lambda tests * check that diamond inference is applied when using raw constructor reference qualifier - * @run main MethodReference41 + * @compile/fail/ref=MethodReference41.out -XDrawDiagnostics MethodReference41.java */ public class MethodReference41 { - static int assertionCount = 0; - - static void assertTrue(boolean cond) { - assertionCount++; - if (!cond) - throw new AssertionError(); - } - interface SAM1 { void m(String s); } @@ -54,13 +46,20 @@ Foo(X x) { } } + static void m1(SAM1 s) { } - static void m(SAM1 s) { assertTrue(false); } - static void m(SAM2 s) { assertTrue(true); } - static void m(SAM3 s) { assertTrue(false); } + static void m2(SAM2 s) { } + + static void m3(SAM3 s) { } + + static void m4(SAM1 s) { } + static void m4(SAM2 s) { } + static void m4(SAM3 s) { } public static void main(String[] args) { - m(Foo::new); - assertTrue(assertionCount == 1); + m1(Foo::new); + m2(Foo::new); + m3(Foo::new); + m4(Foo::new); } }