Type sharpestAccessible ( Type originalType ) { if ( originalType . hasTag ( ARRAY ) ) { return types . makeArrayType ( sharpestAccessible ( types . elemtype ( originalType ) ) ) ; } Type type = originalType ; while ( ! rs . isAccessible ( gen . getAttrEnv ( ) , type . asElement ( ) ) ) { type = types . supertype ( type ) ; } return type ; }
If the type is not accessible from current context try to figure out the sharpest accessible supertype .