Buggy code:
public class IncrementalCase { public static final String [ ] RA_String = new String [ 0 ] ; boolean verbose = true ; boolean ignoreWarnings = false ; public static void main ( String [ ] args ) throws IOException { } public boolean run ( File srcBase , IMessageHandler handler ) throws IOException { } protected boolean verifyCompile ( int iteration , boolean result , File srcDir , File sandboxSrcDir , File sandboxClassesDir , IncrementalCase . Definition def , IMessageHolder compilerMessages , StringBuffer commandLine , IMessageHandler handler ) { } protected File getSandboxDir ( ) throws IOException { } public File outputDir ; protected List getBaseArgs ( File srcDir , File classesDir ) { } protected File makeDir ( File parent , String name , IMessageHandler handler ) { } List normalizeFilenames ( String [ ] ra ) { } List normalizeFilenames ( List list ) { } String normalizeFilename ( String s ) { } boolean haveAll ( String label , String [ ] expected , IMessage [ ] messages , IMessageHandler handler ) { if ( null == expected ) { expected = new String [ 0 ] ; } boolean result = true ; final int [ ] exp = new int [ expected . length ] ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( "[" ) ; for ( int i = 0 ; i < ( exp . length ) ; i ++ ) { String s = expected [ i ] ; int loc = s . lastIndexOf ( ":" ) ; if ( ( - 1 ) != loc ) s = s . substring ( ( loc + 1 ) ) ; try { exp [ i ] = Integer . valueOf ( s ) . intValue ( ) ; sb . append ( ( ( exp [ i ] ) + ( i < ( ( exp . length ) - 1 ) ? ",<seq2seq4repair_space>" : "" ) ) ) ; } catch ( NumberFormatException e ) { info ( handler , ( ( ( "bad<seq2seq4repair_space>" + label ) + ":" ) + ( expected [ i ] ) ) ) ; sb . append ( ( "bad" + ( i < ( ( exp . length ) - 1 ) ? ",<seq2seq4repair_space>" : "]" ) ) ) ; } } sb . append ( "]" ) ; final String context = ( ( ( ( ( label + "\n<seq2seq4repair_space>in<seq2seq4repair_space>context<seq2seq4repair_space>haveAll<seq2seq4repair_space>expected=" ) + ( Arrays . asList ( expected ) ) ) + "<seq2seq4repair_space>exp=" ) + sb ) + "<seq2seq4repair_space>actual=" ) + ( Arrays . asList ( messages ) ) ; info ( handler , context ) ; BitSet foundSet = new BitSet ( 10 ) ; for ( int i = 0 ; i < ( exp . length ) ; i ++ ) { final int expLine = exp [ i ] ; boolean found = false ; for ( int j = 0 ; ( ! found ) && ( j < ( messages . length ) ) ; j ++ ) { <START_BUG> ISourceLocation sl = messages [ j ] . getISourceLocation ( ) ; <END_BUG> found = ( null != sl ) && ( expLine == ( sl . getLine ( ) ) ) ; if ( found ) { info ( handler , ( ( ( "found<seq2seq4repair_space>" + label ) + "<seq2seq4repair_space>for:<seq2seq4repair_space>" ) + ( exp [ i ] ) ) ) ; if ( foundSet . get ( j ) ) { info ( handler , ( ( ( "duplicate<seq2seq4repair_space>" + label ) + "<seq2seq4repair_space>expected:<seq2seq4repair_space>" ) + ( exp [ i ] ) ) ) ; } foundSet . set ( j ) ; } } if ( ! found ) { String s = ( ( ( "expected<seq2seq4repair_space>" + label ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" ) + ( exp [ i ] ) ) + context ; fail ( handler , s ) ; if ( ! result ) { result = false ; } } } sb . setLength ( 0 ) ; for ( int i = 0 ; i < ( messages . length ) ; i ++ ) { if ( ! ( foundSet . get ( i ) ) ) { sb . append ( ( ( ( "\n<seq2seq4repair_space>unexpected<seq2seq4repair_space>" + label ) + "<seq2seq4repair_space>found:<seq2seq4repair_space>" ) + ( messages [ i ] ) ) ) ; } } if ( 0 == ( sb . length ( ) ) ) { return true ; } else { fail ( handler , ( ( sb . toString ( ) ) + context ) ) ; return false ; } } protected void log ( String label , Object o , IMessageHandler handler ) { } protected void info ( IMessageHandler handler , String mssg ) { } protected void fail ( IMessageHandler handler , String mssg ) { } protected void message ( IMessage . Kind kind , String mssg , IMessageHandler handler ) { } IncrementalCase . Definition [ ] getDefinitions ( File srcBase ) { } static class Definition { static final String PATH = "expected.txt" ; boolean expectFail ; String prefix ; String [ ] files ; String [ ] recompiled ; String [ ] errors ; String [ ] warnings ; String [ ] eclipseErrors ; String [ ] eclipseWarnings ; Definition ( String prefix , Properties props ) { } String [ ] get ( Properties props , String key ) { } public String toString ( ) { } String safe ( String [ ] in ) { } } }

Fix:
ISourceLocation sl = messages [ j ] . getSourceLocation ( ) ;