langtools/test/tools/javac/annotations/6359949/T6359949a.java
author sadayapalam
Mon, 03 Jul 2017 12:58:30 +0530
changeset 45758 b2a0122861f5
parent 28705 675cb37e74a8
permissions -rw-r--r--
8068836: Error message should be updated when Override is used with static methods Summary: Issue a more direct, specific error when @Override annotation is used with a static method Reviewed-by: sadayapalam Contributed-by: priya.lakshmi.muthuswamy@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
28705
675cb37e74a8 8068463: Group 10c: golden files for tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     2
 * @test    /nodynamiccopyright/
45758
b2a0122861f5 8068836: Error message should be updated when Override is used with static methods
sadayapalam
parents: 28705
diff changeset
     3
 * @bug     6359949 8068836
b2a0122861f5 8068836: Error message should be updated when Override is used with static methods
sadayapalam
parents: 28705
diff changeset
     4
 * @summary (at)Override of static methods shouldn't be accepted (compiler should issue an error)
28705
675cb37e74a8 8068463: Group 10c: golden files for tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     5
 * @compile/fail/ref=T6359949a.out -XDrawDiagnostics  T6359949a.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
class Example {
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
    public static void example() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
class Test extends Example {
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    public static void example() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
}