public MethodDoc overriddenMethod() {

        // Real overriding only.  Static members are simply hidden.
        // Likewise for constructors, but the MethodSymbol.overrides
        // method takes this into account.
        if ((sym.flags() & Flags.STATIC) != 0) {
            return null;
        }

        // Derived from  com.sun.tools.javac.comp.Check.checkOverride .

        ClassSymbol origin = (ClassSymbol)sym.owner;
        for (Type t = env.types.supertype(origin.type);
             t.hasTag(CLASS);
             t = env.types.supertype(t)) {
            ClassSymbol c = (ClassSymbol)t.tsym;
            for (Scope.Entry e = membersOf(c).lookup(sym.name); e.scope != null; e = e.next()) {
                if (sym.overrides(e.sym, origin, env.types, true)) {
                    return env.getMethodDoc((MethodSymbol)e.sym);
                }
            }
        }
        return null;
    }
public MethodDoc overriddenMethod ( ) { if ( ( sym . flags ( ) & Flags . STATIC ) != 0 ) { return null ; } ClassSymbol origin = ( ClassSymbol ) sym . owner ; for ( Type t = env . types . supertype ( origin . type ) ; t . hasTag ( CLASS ) ; t = env . types . supertype ( t ) ) { ClassSymbol c = ( ClassSymbol ) t . tsym ; for ( Scope . Entry e = membersOf ( c ) . lookup ( sym . name ) ; e . scope != null ; e = e . next ( ) ) { if ( sym . overrides ( e . sym , origin , env . types , true ) ) { return env . getMethodDoc ( ( MethodSymbol ) e . sym ) ; } } } return null ; }
Return the method that this method overrides.

@return a MethodDoc representing a method definition
in a superclass this method overrides, null if
this method does not override.