protected static void addMatchingValues ( List < String > packages , String value , Dependency dep , EvidenceType type ) { if ( value == null || value . isEmpty ( ) || packages == null || packages . isEmpty ( ) ) { return ; } for ( String key : packages ) { final int pos = StringUtils . indexOfIgnoreCase ( value , key ) ; if ( ( pos == 0 && ( key . length ( ) == value . length ( ) || ( key . length ( ) < value . length ( ) && ! Character . isLetterOrDigit ( value . charAt ( key . length ( ) ) ) ) ) ) || ( pos > 0 && ! Character . isLetterOrDigit ( value . charAt ( pos - 1 ) ) && ( pos + key . length ( ) == value . length ( ) || ( key . length ( ) < value . length ( ) && ! Character . isLetterOrDigit ( value . charAt ( pos + key . length ( ) ) ) ) ) ) ) { dep . addEvidence ( type , "dll" , "namespace" , key , Confidence . HIGHEST ) ; } } }
Cycles through the collection of class name information to see if parts of the package names are contained in the provided value . If found it will be added as the HIGHEST confidence evidence because we have more then one source corroborating the value .