public List < JavaComment > stripTags ( final Set < String > tagNames , List < JavaComment > originals ) { final List < JavaComment > results = new ArrayList < JavaComment > ( originals . size ( ) ) ; for ( JavaComment original : originals ) { results . add ( original . match ( new JavaComment . MatchBlock < JavaComment > ( ) { @ Override public JavaComment _case ( JavaDocComment x ) { final List < JDTagSection > newTagSections = new ArrayList < JDTagSection > ( x . tagSections . size ( ) ) ; for ( JDTagSection tagSection : x . tagSections ) { if ( ! tagNames . contains ( tagSection . name ) ) { newTagSections . add ( tagSection ) ; } } return _JavaDocComment ( x . start , x . generalSection , newTagSections , x . end ) ; } @ Override public JavaComment _case ( JavaBlockComment x ) { return x ; } @ Override public JavaComment _case ( JavaEOLComment x ) { return x ; } } ) ) ; } return results ; }
Produce a copy of a list of comments where all javadoc comments have had the specified tags removed . Non javadoc comments are left alone .