langtools/test/tools/javac/7086595/T7086595.java
author mcimadamore
Tue, 13 Sep 2011 14:14:57 +0100
changeset 10626 83f0c2860f5b
permissions -rw-r--r--
7086595: Error message bug: name of initializer is 'null' Summary: Implementation of MethodSymbol.location() should take into account static/instance initializers Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10626
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     1
/*
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     3
 * @bug 7086595
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     4
 * @summary Error message bug: name of initializer is 'null'
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     5
 * @compile/fail/ref=T7086595.out -XDrawDiagnostics T7086595.java
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     6
 */
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     7
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     8
class T7086595 {
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
     9
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    10
    String s = "x";
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    11
    String s = nonExistent;
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    12
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    13
    int foo() {
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    14
        String s = "x";
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    15
        String s = nonExistent;
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    16
    }
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    17
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    18
    static int bar() {
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    19
        String s = "x";
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    20
        String s = nonExistent;
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    21
    }
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    22
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    23
    {
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    24
        String s = "x";
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    25
        String s = nonExistent;
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    26
    }
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    27
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    28
    static {
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    29
        String s = "x";
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    30
        String s = nonExistent;
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    31
    }
83f0c2860f5b 7086595: Error message bug: name of initializer is 'null'
mcimadamore
parents:
diff changeset
    32
}