langtools/test/tools/javac/warnings/suppress/T6707032.java
author jlahoda
Mon, 30 Jun 2014 17:08:06 +0200
changeset 25301 e5da086c7d43
child 30730 d3ce7619db2c
permissions -rw-r--r--
6707032: Division by zero warning not suppressed properly in some cases Summary: Delay reporting of the division by zero warning until annotations are resolved, so that @SuppressWarnings works correctly. Reviewed-by: vromero
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25301
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     1
/**
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     3
 * @bug 6707032
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     4
 * @summary Verify that \\@SuppressWarnings("divzero") works for constant initializers
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     5
 * @build VerifySuppressWarnings
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     6
 * @compile/ref=T6707032.out -XDrawDiagnostics -Xlint:divzero T6707032.java
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     7
 * @run main VerifySuppressWarnings T6707032.java
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     8
 */
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     9
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    10
public class T6707032 {
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    11
    public static final int D1 = T6707032b.D0;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    12
    public static final int D2 = 1/0;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    13
}
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    14
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    15
class T6707032b {
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    16
    public static final int D0 = 1/0;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    17
    public static final int D3 = T6707032.D2;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    18
}