test/tools/javac/annotations/typeAnnotations/newlocations/MultiCatch.java

changeset 1755
ddb4a2bfcd82
parent 1721
abd153854f16
child 2103
b1b4a6dcc282
equal deleted inserted replaced
1754:0384683c64be 1755:ddb4a2bfcd82
23 23
24 import java.lang.annotation.*; 24 import java.lang.annotation.*;
25 25
26 /* 26 /*
27 * @test 27 * @test
28 * @ignore 8013408: Need specification for type exceptions on multicatch
29 * @bug 8006775 28 * @bug 8006775
30 * @summary new type annotation location: multicatch 29 * @summary new type annotation location: multicatch
31 * @author Werner Dietl 30 * @author Werner Dietl
32 * @compile MultiCatch.java 31 * @compile MultiCatch.java
33 */ 32 */
38 System.out.println("Hello 1!"); 37 System.out.println("Hello 1!");
39 } catch (@B NullPointerException | @C IllegalArgumentException e) { 38 } catch (@B NullPointerException | @C IllegalArgumentException e) {
40 e.toString(); 39 e.toString();
41 } 40 }
42 } 41 }
42 /* Disabled: there is no syntax to annotate all components
43 * of the multicatch.
43 void exception02() { 44 void exception02() {
44 try { 45 try {
45 System.out.println("Hello 2!"); 46 System.out.println("Hello 2!");
46 } catch @A (@B NullPointerException | @C IllegalArgumentException e) { 47 } catch @A (@B NullPointerException | @C IllegalArgumentException e) {
47 e.toString(); 48 e.toString();
48 } 49 }
49 } 50 }
51 */
50 } 52 }
51 53
52 class ModifiedVars { 54 class ModifiedVars {
53 /* 55 void exception01() {
54 void exception() {
55 try { 56 try {
56 arrays(); 57 System.out.println("Hello 1!");
57 } catch (final @A Exception e) { 58 } catch (final @B NullPointerException | @C IllegalArgumentException e) {
58 e.toString(); 59 e.toString();
59 } 60 }
60 } 61 }
61 */ 62 void exception02() {
63 try {
64 System.out.println("Hello 1!");
65 } catch (@Decl @B NullPointerException | @C IllegalArgumentException e) {
66 e.toString();
67 }
68 }
62 } 69 }
63 70
64 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 71 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
65 @interface A { } 72 @interface A { }
66 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 73 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
67 @interface B { } 74 @interface B { }
68 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 75 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
69 @interface C { } 76 @interface C { }
70 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 77
71 @interface D { } 78 @interface Decl { }

mercurial