langtools/test/tools/javac/T6247324.java
author katleman
Thu, 21 Aug 2014 14:16:14 -0700
changeset 25878 6d561031123e
parent 6150 d055fa8ced62
permissions -rw-r--r--
Added tag jdk9-b27 for changeset 98ce0879ab4c
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
6150
d055fa8ced62 6971882: Remove -XDstdout from javac test
jjg
parents: 10
diff changeset
     4
 * @compile/fail/ref=T6247324.out -XDrawDiagnostics -Xlint -Xlint:-path T6247324.java
10
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
}