Replaced hack for isTypeShared() and isMethodShared() with proper implementation