Buggy code:
public class Spotting { String corpusPath ; CorpusInformationSpecification cis ; RuleBasedDriver rbased ; private Map < String , String > countryFreebaseIdMap ; public Spotting ( String corpusPath , CorpusInformationSpecification cis , RuleBasedDriver rbased ) { } public void iterateAndSpot ( String outputFile , Corpus c ) throws IOException , SQLException { PrintWriter pw = new PrintWriter ( outputFile ) ; System . out . println ( "Reading<seq2seq4repair_space>the<seq2seq4repair_space>docs" ) ; Iterator < Annotation > di = c . getDocumentIterator ( ) ; if ( null == di ) { System . out . println ( "NULL" ) ; } List < Pair < Triple < KBArgument , KBArgument , String > , Integer > > kbArgRelnList = new ArrayList < Pair < Triple < KBArgument , KBArgument , String > , Integer > > ( ) ; ArrayList < Pair < Integer , Relation > > relationList = new ArrayList < Pair < Integer , Relation > > ( ) ; int sentID = 0 ; System . out . println ( "Starting<seq2seq4repair_space>rule<seq2seq4repair_space>based<seq2seq4repair_space>distant<seq2seq4repair_space>supervision" ) ; int numProcessed = 0 ; int ignored = 0 ; while ( di . hasNext ( ) ) { Annotation d = di . next ( ) ; if ( null == d ) { System . out . println ( d ) ; } List < CoreMap > sentences = d . get ( SentencesAnnotation . class ) ; for ( CoreMap sentence : sentences ) { numProcessed ++ ; sentID = sentence . get ( SentGlobalID . class ) ; <START_BUG> if ( ( numProcessed % 100 ) == 0 ) { <END_BUG> System . out . println ( ( ( ( "Processed:<seq2seq4repair_space>" + numProcessed ) + "<seq2seq4repair_space>,<seq2seq4repair_space>ignored:<seq2seq4repair_space>" ) + ignored ) ) ; } if ( ( sentence . toString ( ) . length ( ) ) > 350 ) { ignored ++ ; continue ; } try { List < CoreLabel > tokens = sentence . get ( TokensAnnotation . class ) ; for ( int i = 0 ; i < ( tokens . size ( ) ) ; i ++ ) { CoreLabel token = tokens . get ( i ) ; int begOffset = token . get ( SentenceRelativeCharacterOffsetBeginAnnotation . class ) ; int endOffset = token . get ( SentenceRelativeCharacterOffsetEndAnnotation . class ) ; token . set ( TokenBeginAnnotation . class , begOffset ) ; token . set ( TokenEndAnnotation . class , endOffset ) ; } List < Triple < Integer , String , Integer > > deps = sentence . get ( DependencyAnnotation . class ) ; List < Relation > currRels = rbased . spotPossibleRelations ( deps , sentence ) ; for ( Relation rel : currRels ) { relationList . add ( new Pair < Integer , Relation > ( sentID , rel ) ) ; } } catch ( Exception e ) { System . out . println ( e ) ; continue ; } } } for ( Pair < Integer , Relation > irPair : relationList ) { Relation r = irPair . second ; sentID = irPair . first ; Word location = r . getCountry ( ) ; Number number = r . getNumber ( ) ; String relName = r . getRelName ( ) ; String countryId = countryFreebaseIdMap . get ( location . getVal ( ) ) ; KBArgument countryArg = new KBArgument ( new edu . washington . multirframework . data . Argument ( location . getVal ( ) , location . getStartOff ( ) , location . getEndOff ( ) ) , countryId ) ; KBArgument numberArg = new KBArgument ( new edu . washington . multirframework . data . Argument ( number . getVal ( ) , number . getStartOff ( ) , number . getEndOff ( ) ) , number . getVal ( ) ) ; Triple < KBArgument , KBArgument , String > relTrip = new Triple < KBArgument , KBArgument , String > ( countryArg , numberArg , relName ) ; Pair < Triple < KBArgument , KBArgument , String > , Integer > relTripSentIdPair = new Pair ( relTrip , sentID ) ; kbArgRelnList . add ( relTripSentIdPair ) ; } Spotting . writeDistantSupervisionAnnotations ( kbArgRelnList , pw ) ; pw . close ( ) ; } public static void writeDistantSupervisionAnnotations ( List < Pair < Triple < KBArgument , KBArgument , String > , Integer > > distantSupervisionAnnotations , PrintWriter dsWriter ) { } }

Fix:
if ( ( numProcessed % 1000 ) == 0 ) {