private static boolean isGosuClassAccessingProtectedOrInternalMethodOfClassInDifferentClassloader ( ICompilableTypeInternal callingClass , IType declaringClass , IRelativeTypeInfo . Accessibility accessibility ) { return ( accessibility != IRelativeTypeInfo . Accessibility . PUBLIC || AccessibilityUtil . forType ( declaringClass ) == IRelativeTypeInfo . Accessibility . INTERNAL || AccessibilityUtil . forType ( declaringClass ) == IRelativeTypeInfo . Accessibility . PRIVATE ) && getTopLevelNamespace ( callingClass ) . equals ( getTopLevelNamespace ( declaringClass ) ) && ( isInSeparateClassLoader ( callingClass , declaringClass ) || classesLoadInSeparateLoader ( callingClass , declaringClass ) ) ; }
Java will blow up if the package - level access is relied upon across class loaders though so we make the call reflectively .