Mon, 16 Sep 2013 14:13:44 +0200
8021112: Spurious unchecked warning reported by javac
6480588: No way to suppress deprecation warnings when implementing deprecated interface
Summary: Fixing DeferredLintHandler configuration, so lint warnings are reported with correct @SuppressWarnings settings
Reviewed-by: jjg, vromero
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8003280
4 * @summary Add lambda tests
5 * check that diamond inference is applied when using raw constructor reference qualifier
6 * @compile/fail/ref=MethodReference42.out -XDrawDiagnostics MethodReference42.java
7 */
9 public class MethodReference42 {
11 static class SuperFoo<X> { }
13 static class Foo<X extends Number> extends SuperFoo<X> { }
15 interface SAM1 {
16 SuperFoo<String> m();
17 }
19 interface SAM2 {
20 SuperFoo<Integer> m();
21 }
23 interface SAM3 {
24 SuperFoo<Object> m();
25 }
27 static void m1(SAM1 s) { }
29 static void m2(SAM2 s) { }
31 static void m3(SAM3 s) { }
33 static void m4(SAM1 s) { }
34 static void m4(SAM2 s) { }
35 static void m4(SAM3 s) { }
37 public static void main(String[] args) {
38 m1(Foo::new);
39 m2(Foo::new);
40 m3(Foo::new);
41 m4(Foo::new);
42 }
43 }