test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java

changeset 1755
ddb4a2bfcd82
parent 1534
bec996065c45
child 2525
2eb010b6cb22
     1.1 --- a/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java	Tue May 14 13:55:35 2013 -0700
     1.2 +++ b/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java	Tue May 14 15:04:06 2013 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2009, 2013, 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 @@ -54,4 +54,24 @@
    1.11      public String interfaceMethod() {
    1.12          return "interface Test { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
    1.13      }
    1.14 +
    1.15 +    @TADescriptions({
    1.16 +        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0,
    1.17 +                       genericLocation = {}),
    1.18 +        @TADescription(annotation = "TB", type = THROWS, typeIndex = 0,
    1.19 +                       genericLocation = {1, 0}),
    1.20 +        @TADescription(annotation = "TC", type = THROWS, typeIndex = 0,
    1.21 +                       genericLocation = {1, 0, 1, 0}),
    1.22 +        @TADescription(annotation = "TD", type = THROWS, typeIndex = 1,
    1.23 +                       genericLocation = {}),
    1.24 +        @TADescription(annotation = "TE", type = THROWS, typeIndex = 1,
    1.25 +                       genericLocation = {1, 0}),
    1.26 +        @TADescription(annotation = "TF", type = THROWS, typeIndex = 1,
    1.27 +                       genericLocation = {1, 0, 1, 0})
    1.28 +    })
    1.29 +    public String NestedTypes() {
    1.30 +        return "class Outer { class Middle { class Inner1 extends Exception {}" +
    1.31 +                "  class Inner2 extends Exception{} } }" +
    1.32 +                "class Test { void test() throws @TA Outer.@TB Middle.@TC Inner1, @TD Outer.@TE Middle.@TF Inner2 { } }";
    1.33 +    }
    1.34  }

mercurial