langtools/test/tools/javac/NonStaticFieldExpr3.java
author ssides
Wed, 09 Jul 2014 15:14:06 +0400
changeset 25760 7955db32d6b0
parent 6150 d055fa8ced62
permissions -rw-r--r--
8046597: fix doclint issues in swing classes, part 4 of 4 Reviewed-by: pchelko

/* @test  /nodynamiccopyright/
   @bug 4087127 4785453
   @author dps
   @summary class: instance access through types is not allowed

   @compile/fail/ref=NonStaticFieldExpr3.out -XDrawDiagnostics NonStaticFieldExpr3.java
*/

class NonStaticFieldExpr3 {
  public int x;
}

class Subclass extends NonStaticFieldExpr3 {
  int a = NonStaticFieldExpr3.x;      // SHOULD BE ERROR
}