langtools/test/tools/javac/T6247324.java
author mikejwre
Wed, 09 Jun 2010 18:56:41 -0700
changeset 5634 895b66935810
parent 10 06bc494ca11e
child 6150 d055fa8ced62
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * @test  /nodynamiccopyright/
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 6247324
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @compile/fail/ref=T6247324.out -XDrawDiagnostics -XDstdout -Xlint -Xlint:-path T6247324.java
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
class Pair<X,Y> {
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
    private X x;
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
    private Y y;
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
    public Pair(X x, Y y){
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
        this.x = x;
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
        this.y = y;
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
    public X getX(){
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
        return x;
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    @Seetharam // Undefined annotation...
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
    public Y getY(){
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
        return y;
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
public class T6247324{
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
    public void myMethod(){
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
        Pair<Integer, String> pair = new Pair<Integer, String>(0, "I am not sure");
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
        int intValue = pair.getX();
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
        String strValue = pair.getY();
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
}