Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Qualified name refs and generics

I got qualified name references to work with gene     rics... Now we can
compile/run the following program...


public class X <T> extends p.A<T> {
    protected T t;
    X(T t) {
        super(t);
        this.t = t;
    }
    public static void main(String[] args) {
        X<X<String>> xs = new X<X<String>>(new X<String>("SUCCESS"));
        System.out.println(xs.t.t);
    }
}
--------
package p;
public class A<P> {
    protected P p;
    protected A(P p) {
        this.p = p;
    }
}

with "xs.t.t" expand into:

    20  aload_1
    21  getfield #17 <Field X#t java.lang.Object>
    24  checkcast #33 X
    27  getfield #17 <Field X#t java.lang.Object>
    30  checkcast #35 java.lang.String




Back to the top