private Set < FileAnnotation > applyExcludeFilter ( final Set < FileAnnotation > allAnnotations ) { Set < FileAnnotation > includedAnnotations ; if ( includePatterns . isEmpty ( ) ) { includedAnnotations = allAnnotations ; } else { includedAnnotations = Sets . newHashSet ( ) ; for ( FileAnnotation annotation : allAnnotations ) { for ( Pattern include : includePatterns ) { if ( include . matcher ( annotation . getFileName ( ) ) . matches ( ) ) { includedAnnotations . add ( annotation ) ; } } } } if ( excludePatterns . isEmpty ( ) ) { return includedAnnotations ; } else { Set < FileAnnotation > excludedAnnotations = Sets . newHashSet ( includedAnnotations ) ; for ( FileAnnotation annotation : includedAnnotations ) { for ( Pattern exclude : excludePatterns ) { if ( exclude . matcher ( annotation . getFileName ( ) ) . matches ( ) ) { excludedAnnotations . remove ( annotation ) ; } } } return excludedAnnotations ; } }
Applies the exclude filter to the found annotations .