private boolean isSafeValue ( Scope scope , Node argument ) { if ( NodeUtil . isSomeCompileTimeConstStringValue ( argument ) ) { return true ; } else if ( argument . isAdd ( ) ) { Node left = argument . getFirstChild ( ) ; Node right = argument . getLastChild ( ) ; return isSafeValue ( scope , left ) && isSafeValue ( scope , right ) ; } else if ( argument . isName ( ) ) { String name = argument . getString ( ) ; Var var = scope . getVar ( name ) ; if ( var == null || ! var . isInferredConst ( ) ) { return false ; } Node initialValue = var . getInitialValue ( ) ; if ( initialValue == null ) { return false ; } return isSafeValue ( var . getScope ( ) , initialValue ) ; } return false ; }
Checks if the method call argument is made of constant string literals .