protected Set < String > normalizeWhitelist ( Set < String > whitelist ) { Set < String > result = new HashSet <> ( ) ; for ( String line : whitelist ) { String trimmed = line . trim ( ) ; if ( trimmed . isEmpty ( ) || trimmed . charAt ( 0 ) == ' ' ) { // strip out empty lines and comments. continue ; } // Strip line number for matching. result . add ( LINE_NUMBER . matcher ( trimmed ) . replaceFirst ( ":" ) ) ; } return ImmutableSet . copyOf ( result ) ; }
Loads legacy warnings list from the set of strings . During development line numbers are changed very often - we just cut them and compare without ones .