langtools/test/tools/javac/T6247324.java
author xdono
Wed, 02 Jul 2008 12:56:02 -0700
changeset 735 372aa565a221
parent 10 06bc494ca11e
child 6150 d055fa8ced62
permissions -rw-r--r--
6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
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
}