test/tools/javac/annotations/typeAnnotations/failures/LazyConstantValue.java

Tue, 14 May 2013 15:04:06 -0700

author
jjg
date
Tue, 14 May 2013 15:04:06 -0700
changeset 1755
ddb4a2bfcd82
parent 1563
bc456436c613
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8013852: update reference impl for type-annotations
Reviewed-by: jjg
Contributed-by: wdietl@gmail.com, steve.sides@oracle.com, joel.franck@oracle.com, alex.buckley@oracle.com

jjg@1563 1 /*
jjg@1563 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
jjg@1563 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jjg@1563 4 *
jjg@1563 5 * This code is free software; you can redistribute it and/or modify it
jjg@1563 6 * under the terms of the GNU General Public License version 2 only, as
jjg@1563 7 * published by the Free Software Foundation.
jjg@1563 8 *
jjg@1563 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jjg@1563 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jjg@1563 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jjg@1563 12 * version 2 for more details (a copy is included in the LICENSE file that
jjg@1563 13 * accompanied this code).
jjg@1563 14 *
jjg@1563 15 * You should have received a copy of the GNU General Public License version
jjg@1563 16 * 2 along with this work; if not, write to the Free Software Foundation,
jjg@1563 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jjg@1563 18 *
jjg@1563 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jjg@1563 20 * or visit www.oracle.com if you need additional information or have any
jjg@1563 21 * questions.
jjg@1563 22 */
jjg@1563 23
jjg@1563 24 /*
jjg@1563 25 * @test
jjg@1563 26 * @bug 8008077
jjg@1563 27 * @summary Type annotations in a lazy constant need to be attributed
jjg@1563 28 * in the correct order.
jjg@1563 29 * @author Werner Dietl
jjg@1755 30 * @compile/ref=LazyConstantValue.out LazyConstantValue.java
jjg@1563 31 */
jjg@1563 32
jjg@1563 33 import java.lang.annotation.*;
jjg@1563 34
jjg@1563 35 class ClassA {
jjg@1563 36 Object o = ClassB.lcv;
jjg@1563 37 }
jjg@1563 38
jjg@1563 39 class ClassB {
jjg@1563 40 static final String[] lcv = new @TA String[0];
jjg@1563 41 }
jjg@1563 42
jjg@1755 43 class ClassC {
jjg@1755 44 static final Object o = (@TA Object) null;
jjg@1755 45 }
jjg@1755 46
jjg@1563 47 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
jjg@1563 48 @interface TA {}

mercurial