public static Taint merge ( Taint a , Taint b ) { if ( a == null ) { if ( b == null ) { return null ; } else { return new Taint ( b ) ; } } else if ( b == null ) { return new Taint ( a ) ; } assert a != null && b != null ; Taint result = new Taint ( State . merge ( a . getState ( ) , b . getState ( ) ) ) ; if ( a . variableIndex == b . variableIndex ) { result . variableIndex = a . variableIndex ; } result . taintLocations . addAll ( a . taintLocations ) ; result . taintLocations . addAll ( b . taintLocations ) ; result . unknownLocations . addAll ( a . unknownLocations ) ; result . unknownLocations . addAll ( b . unknownLocations ) ; if ( ! result . isTainted ( ) ) { mergeParameters ( a , b , result ) ; } mergeRealInstanceClass ( a , b , result ) ; mergeTags ( a , b , result ) ; if ( a . constantValue != null && a . constantValue . equals ( b . constantValue ) ) { result . constantValue = a . constantValue ; } if ( FindSecBugsGlobalConfig . getInstance ( ) . isDebugTaintState ( ) ) { result . setDebugInfo ( "[" + a . getDebugInfo ( ) + "]+[" + b . getDebugInfo ( ) + "]" ) ; } assert ! result . hasParameters ( ) || result . isUnknown ( ) ; if ( a . potentialValue != null ) { result . potentialValue = a . potentialValue ; } else if ( b . potentialValue != null ) { result . potentialValue = b . potentialValue ; } result . addAllSources ( a . sources ) ; result . addAllSources ( b . sources ) ; return result ; }
Returns the merge of the facts such that it can represent any of them