test/tools/javac/generics/diamond/pos/Pos02.java

changeset 914
ca32f2986301
parent 554
9d9f26857129
child 2525
2eb010b6cb22
     1.1 --- a/test/tools/javac/generics/diamond/pos/Pos02.java	Mon Mar 07 14:11:48 2011 +0000
     1.2 +++ b/test/tools/javac/generics/diamond/pos/Pos02.java	Mon Mar 07 14:31:50 2011 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -23,9 +23,9 @@
    1.11  
    1.12  /*
    1.13   * @test
    1.14 - * @bug 6939620
    1.15 + * @bug 6939620 7020044
    1.16   *
    1.17 - * @summary  Switch to 'complex' diamond inference scheme
    1.18 + * @summary  basic test for diamond (simple/qualified type-expressions)
    1.19   * @author mcimadamore
    1.20   * @compile Pos02.java
    1.21   * @run main Pos02
    1.22 @@ -44,20 +44,10 @@
    1.23          Foo<?> f3 = new Foo<>(1);
    1.24          Foo<? super Integer> f4 = new Foo<>(1);
    1.25  
    1.26 -        Foo<Integer> f5 = new Foo<>(1){};
    1.27 -        Foo<? extends Integer> f6 = new Foo<>(1){};
    1.28 -        Foo<?> f7 = new Foo<>(1){};
    1.29 -        Foo<? super Integer> f8 = new Foo<>(1){};
    1.30 -
    1.31 -        Foo<Integer> f9 = new Foo<>(1, "");
    1.32 -        Foo<? extends Integer> f10 = new Foo<>(1, "");
    1.33 -        Foo<?> f11 = new Foo<>(1, "");
    1.34 -        Foo<? super Integer> f12 = new Foo<>(1, "");
    1.35 -
    1.36 -        Foo<Integer> f13 = new Foo<>(1, ""){};
    1.37 -        Foo<? extends Integer> f14 = new Foo<>(1, ""){};
    1.38 -        Foo<?> f15 = new Foo<>(1, ""){};
    1.39 -        Foo<? super Integer> f16 = new Foo<>(1, ""){};
    1.40 +        Foo<Integer> f5 = new Foo<>(1, "");
    1.41 +        Foo<? extends Integer> f6 = new Foo<>(1, "");
    1.42 +        Foo<?> f7 = new Foo<>(1, "");
    1.43 +        Foo<? super Integer> f8 = new Foo<>(1, "");
    1.44      }
    1.45  
    1.46      void testQualified() {
    1.47 @@ -66,20 +56,10 @@
    1.48          Foo<?> f3 = new Pos02.Foo<>(1);
    1.49          Foo<? super Integer> f4 = new Pos02.Foo<>(1);
    1.50  
    1.51 -        Foo<Integer> f5 = new Pos02.Foo<>(1){};
    1.52 -        Foo<? extends Integer> f6 = new Pos02.Foo<>(1){};
    1.53 -        Foo<?> f7 = new Pos02.Foo<>(1){};
    1.54 -        Foo<? super Integer> f8 = new Pos02.Foo<>(1){};
    1.55 -
    1.56 -        Foo<Integer> f9 = new Pos02.Foo<>(1, "");
    1.57 -        Foo<? extends Integer> f10 = new Pos02.Foo<>(1, "");
    1.58 -        Foo<?> f11 = new Pos02.Foo<>(1, "");
    1.59 -        Foo<? super Integer> f12 = new Pos02.Foo<>(1, "");
    1.60 -
    1.61 -        Foo<Integer> f13 = new Pos02.Foo<>(1, ""){};
    1.62 -        Foo<? extends Integer> f14 = new Pos02.Foo<>(1, ""){};
    1.63 -        Foo<?> f15 = new Pos02.Foo<>(1, ""){};
    1.64 -        Foo<? super Integer> f16 = new Pos02.Foo<>(1, ""){};
    1.65 +        Foo<Integer> f5 = new Pos02.Foo<>(1, "");
    1.66 +        Foo<? extends Integer> f6 = new Pos02.Foo<>(1, "");
    1.67 +        Foo<?> f7 = new Pos02.Foo<>(1, "");
    1.68 +        Foo<? super Integer> f8 = new Pos02.Foo<>(1, "");
    1.69      }
    1.70  
    1.71      public static void main(String[] args) {

mercurial