private void checkPropertyDeprecation ( NodeTraversal t , PropertyReference propRef ) { if ( ! shouldEmitDeprecationWarning ( t , propRef ) ) { return ; } // Don't bother checking constructors. if ( propRef . getSourceNode ( ) . getParent ( ) . isNew ( ) ) { return ; } ObjectType objectType = castToObject ( dereference ( propRef . getReceiverType ( ) ) ) ; String propertyName = propRef . getName ( ) ; if ( objectType != null ) { String deprecationInfo = getPropertyDeprecationInfo ( objectType , propertyName ) ; if ( deprecationInfo != null ) { if ( ! deprecationInfo . isEmpty ( ) ) { compiler . report ( JSError . make ( propRef . getSourceNode ( ) , DEPRECATED_PROP_REASON , propertyName , propRef . getReadableTypeNameOrDefault ( ) , deprecationInfo ) ) ; } else { compiler . report ( JSError . make ( propRef . getSourceNode ( ) , DEPRECATED_PROP , propertyName , propRef . getReadableTypeNameOrDefault ( ) ) ) ; } } } }
Checks the given GETPROP node to ensure that access restrictions are obeyed .