private int fromInstance(Symbol symbol, Symbol owner) { int i = -1; Type ownerType = owner.type(); for (Symbol outerClass : outerClasses) { i++; if (symbol.equals(outerClass) || (ownerType != null && owner.isTypeSymbol() && outerClass.type().isSubtypeOf(ownerType))) { return i; } } return -1; }