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

changeset 1755
ddb4a2bfcd82
parent 1534
bec996065c45
child 2525
2eb010b6cb22
     1.1 --- a/test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.java	Tue May 14 13:55:35 2013 -0700
     1.2 +++ b/test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.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 @@ -75,4 +75,81 @@
    1.11          return "void eqtestObjectGeneric() { if (null == new @TA ArrayList<@TB String >()); }";
    1.12      }
    1.13  
    1.14 +    @TADescriptions({
    1.15 +        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.16 +                genericLocation = {0, 0}),
    1.17 +        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
    1.18 +    })
    1.19 +    public String returnNewArray1() {
    1.20 +        return "Object returnNewArray1() { return new @TA String @TB[1]; }";
    1.21 +    }
    1.22 +
    1.23 +    @TADescriptions({
    1.24 +        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.25 +                genericLocation = {0, 0, 0, 0}),
    1.26 +        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
    1.27 +        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.28 +                genericLocation = {0, 0}),
    1.29 +    })
    1.30 +    public String returnNewArray2() {
    1.31 +        return "Object returnNewArray2() { return new @TA String @TB [1] @TC [2]; }";
    1.32 +    }
    1.33 +
    1.34 +    @TADescriptions({
    1.35 +        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.36 +                genericLocation = {0, 0, 0, 0}),
    1.37 +        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.38 +                genericLocation = {0, 0, 0, 0, 1, 0}),
    1.39 +        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
    1.40 +        @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.41 +                genericLocation = {0, 0}),
    1.42 +    })
    1.43 +    public String returnNewArray3() {
    1.44 +        return "Object returnNewArray3() { return new @TA Outer. @TB Inner @TC [1] @TD [2]; }";
    1.45 +    }
    1.46 +
    1.47 +    @TADescriptions({
    1.48 +        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.49 +                genericLocation = {0, 0, 0, 0}),
    1.50 +        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.51 +                genericLocation = {0, 0, 0, 0, 1, 0}),
    1.52 +        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.53 +                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}),
    1.54 +        @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
    1.55 +        @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.56 +                genericLocation = {0, 0}),
    1.57 +    })
    1.58 +    public String returnNewArray4() {
    1.59 +        return "Object returnNewArray4() { return new @TA Outer. @TB Middle. @TC MInner @TD [1] @TE [2]; }";
    1.60 +    }
    1.61 +
    1.62 +    @TADescriptions({
    1.63 +        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
    1.64 +        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.65 +                genericLocation = {3, 0, 0, 0, 0, 0}),
    1.66 +        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.67 +                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}),
    1.68 +        @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.69 +                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}),
    1.70 +        @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.71 +                genericLocation = {3, 0}),
    1.72 +        @TADescription(annotation = "TF", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.73 +                genericLocation = {3, 0, 0, 0}),
    1.74 +    })
    1.75 +    public String returnNewArray5() {
    1.76 +        return "Object returnNewArray5() { return new @TA ArrayList<@TB Outer. @TC Middle. @TD MInner @TE [] @TF []>(); }";
    1.77 +    }
    1.78 +
    1.79 +    @TADescriptions({
    1.80 +        @TADescription(annotation = "TA", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.81 +                genericLocation = {0, 0, 0, 0}),
    1.82 +        @TADescription(annotation = "TB", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.83 +                genericLocation = {0, 0, 0, 0, 1, 0}),
    1.84 +        @TADescription(annotation = "TC", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE),
    1.85 +        @TADescription(annotation = "TD", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
    1.86 +        genericLocation = {0, 0}),
    1.87 +    })
    1.88 +    public String arrayField() {
    1.89 +        return "@TA Outer. @TB Inner @TC [] @TD [] f;";
    1.90 +    }
    1.91  }

mercurial