private Symbol hiddenInInternal(ClassSymbol currentClass, Types types) {
        if (currentClass == owner) {
            return this;
        }
        for (Symbol sym : currentClass.members().getSymbolsByName(name)) {
            if (sym.kind == kind &&
                    (kind != MTH ||
                    (sym.flags() & STATIC) != 0 &&
                    types.isSubSignature(sym.type, type))) {
                return sym;
            }
        }
        Symbol hiddenSym = null;
        for (Type st : types.interfaces(currentClass.type)
                .prepend(types.supertype(currentClass.type))) {
            if (st != null && (st.hasTag(CLASS))) {
                Symbol sym = hiddenInInternal((ClassSymbol)st.tsym, types);
                if (sym == this) {
                    return this;
                } else if (sym != null) {
                    hiddenSym = sym;
                }
            }
        }
        return hiddenSym;
    }
private Symbol hiddenInInternal ( ClassSymbol currentClass , Types types ) { if ( currentClass == owner ) { return this ; } for ( Symbol sym : currentClass . members ( ) . getSymbolsByName ( name ) ) { if ( sym . kind == kind && ( kind != MTH || ( sym . flags ( ) & STATIC ) != 0 && types . isSubSignature ( sym . type , type ) ) ) { return sym ; } } Symbol hiddenSym = null ; for ( Type st : types . interfaces ( currentClass . type ) . prepend ( types . supertype ( currentClass . type ) ) ) { if ( st != null && ( st . hasTag ( CLASS ) ) ) { Symbol sym = hiddenInInternal ( ( ClassSymbol ) st . tsym , types ) ; if ( sym == this ) { return this ; } else if ( sym != null ) { hiddenSym = sym ; } } } return hiddenSym ; }
This method looks in the supertypes graph that has the current class as the
initial node, till it finds the current symbol or another symbol that hides it.
If the current class has more than one supertype (extends one class and
implements one or more interfaces) then null can be returned, meaning that
a wrong path in the supertypes graph was selected. Null can only be returned
as a temporary value, as a result of the recursive call.