private boolean canAccessDeprecatedTypes ( NodeTraversal t ) { Node scopeRoot = t . getClosestHoistScopeRoot ( ) ; if ( NodeUtil . isFunctionBlock ( scopeRoot ) ) { scopeRoot = scopeRoot . getParent ( ) ; } Node scopeRootParent = scopeRoot . getParent ( ) ; return // Case #1 ( deprecationDepth > 0 ) // Case #2 || ( getTypeDeprecationInfo ( getTypeOfThis ( scopeRoot ) ) != null ) // Case #3 || ( scopeRootParent != null && scopeRootParent . isAssign ( ) && getTypeDeprecationInfo ( bestInstanceTypeForMethodOrCtor ( scopeRoot ) ) != null ) ; }
Returns whether it s currently OK to access deprecated names and properties .