Wed, 27 Apr 2016 01:34:52 +0800
Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/
changeset: 2573:53ca196be1ae
tag: jdk8u25-b17
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 6843077 8006775
4 * @summary static field access isn't a valid location
5 * @author Mahmood Ali
6 * @compile/fail/ref=StaticFields.out -XDrawDiagnostics StaticFields.java
7 */
8 import java.lang.annotation.*;
10 class C {
11 static int f;
12 // static block
13 static {
14 @A C.f = 1;
15 }
16 // static ref
17 int a = @A C.f;
18 // static method
19 static int f() { return @A C.f; }
20 // main
21 public static void main(String... args) {
22 int a = @A C.f;
23 }
24 }
26 @Target(ElementType.TYPE_USE)
27 @interface A { }