private Set < Artifact > checkDependencies ( Set < Artifact > dependencies , List < String > thePatterns ) throws EnforcerRuleException { Set < Artifact > foundMatches = null ; if ( thePatterns != null && thePatterns . size ( ) > 0 ) { for ( String pattern : thePatterns ) { String [ ] subStrings = pattern . split ( ":" ) ; subStrings = StringUtils . stripAll ( subStrings ) ; for ( Artifact artifact : dependencies ) { if ( compareDependency ( subStrings , artifact ) ) { // only create if needed if ( foundMatches == null ) { foundMatches = new HashSet < Artifact > ( ) ; } foundMatches . add ( artifact ) ; } } } } return foundMatches ; }
Checks the set of dependencies against the list of patterns .