src/share/classes/com/sun/tools/javac/code/Symbol.java

changeset 341
85fecace920b
parent 308
03944ee4fac4
child 428
2485f5641ed0
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Jul 29 13:26:26 2009 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Jul 30 10:29:53 2009 +0100
     1.3 @@ -1197,21 +1197,9 @@
     1.4           *  as possible implementations.
     1.5           */
     1.6          public MethodSymbol implementation(TypeSymbol origin, Types types, boolean checkResult) {
     1.7 -            for (Type t = origin.type; t.tag == CLASS || t.tag == TYPEVAR; t = types.supertype(t)) {
     1.8 -                while (t.tag == TYPEVAR)
     1.9 -                    t = t.getUpperBound();
    1.10 -                TypeSymbol c = t.tsym;
    1.11 -                for (Scope.Entry e = c.members().lookup(name);
    1.12 -                     e.scope != null;
    1.13 -                     e = e.next()) {
    1.14 -                    if (e.sym.kind == MTH) {
    1.15 -                        MethodSymbol m = (MethodSymbol) e.sym;
    1.16 -                        if (m.overrides(this, origin, types, checkResult) &&
    1.17 -                            (m.flags() & SYNTHETIC) == 0)
    1.18 -                            return m;
    1.19 -                    }
    1.20 -                }
    1.21 -            }
    1.22 +            MethodSymbol res = types.implementation(this, origin, types, checkResult);
    1.23 +            if (res != null)
    1.24 +                return res;
    1.25              // if origin is derived from a raw type, we might have missed
    1.26              // an implementation because we do not know enough about instantiations.
    1.27              // in this case continue with the supertype as origin.

mercurial