Buggy code:
public class ParserComposition2 extends ParserComposition { public ParserComposition2 ( boolean isGloballyRecursive , IParser ... parsers ) { } public ParserComposition2 ( IParser ... parsers ) { } protected ParserComposition2 . TokenModificationRegistry reg ; protected void initRegistry ( ) { } private void setHandleBoundsFalse ( ) { } @ Override public List < IToken > process ( List < IToken > tokens ) { } protected static class ParserData { public ParserData ( ParserComposition2 . TokenModificationRegistry reg , IParser ap , int id ) { } private final ParserComposition2 . TokenModificationRegistry reg ; private final IParser parser ; private final int parserId ; private List < IToken > result ; private boolean isFinished = false ; public List < IToken > process ( List < IToken > tokens ) { } public List < IToken > getNewTokens ( ) { } public void processModificationData ( ) { } public List < IToken > getResult ( ) { } public void setResult ( List < IToken > result ) { } public boolean isFinished ( ) { } public void setFinished ( boolean isFinished ) { } public void setNeedRepeat ( ) { } @ Override public String toString ( ) { } public void setTokenIdProvider ( TokenIdProvider tip ) { } } protected static class TokenModificationData { public TokenModificationData ( ParserComposition2 . TokenModificationRegistry reg , IToken token , IToken producedToken , int parserId , int modType ) { } private static int CONSUMED = 0 ; private static int ENRICHED = 1 ; private ParserComposition2 . TokenModificationRegistry reg ; private int parserId ; private IToken token ; private IToken producedToken ; private int modType ; private boolean isCanceled = false ; public int getParserId ( ) { } public void setParserId ( int parserId ) { } public int getModType ( ) { } public void setModType ( int modType ) { } public IToken getProducedToken ( ) { } public boolean isCanceled ( ) { } public void setCanceled ( boolean isCanceled , int validParserId ) { } public boolean isEnriched ( ) { } @ Override public String toString ( ) { } } protected static class TokenModificationRegistry { private ArrayList < ParserComposition2 . ParserData > parserDataList = new ArrayList < ParserComposition2 . ParserData > ( ) ; private IntObjectOpenHashMap < List < ParserComposition2 . TokenModificationData > > map = new IntObjectOpenHashMap < List < ParserComposition2 . TokenModificationData > > ( ) ; private List < IToken > original ; private List < IToken > currentTokensArray ; private IntOpenHashSet cancelledProducedTokens = new IntOpenHashSet ( ) ; private HashSet < IToken > modifiedTokens = new HashSet < IToken > ( ) ; public void cancelProducedToken ( int id ) { } public TokenModificationRegistry ( IParser [ ] parsers ) { } public void enableParserRepeat ( int parserId ) { } public List < IToken > process ( List < IToken > tokens ) { } private List < IToken > collectTokens ( ) { } protected void markPreservedTokens ( IntObjectOpenHashMap < IToken > newTokensMap , IntObjectOpenHashMap < IToken > resultTokensMap ) { } private void checkNeighbours ( IntObjectOpenHashMap < IToken > resultTokensMap , IToken token , Direction dir ) { } private void prepare ( List < IToken > tokens ) { } protected void clean ( ) { } protected void resolveConflicts ( ) { <START_BUG> for ( IToken t : original ) { <END_BUG> List < ParserComposition2 . TokenModificationData > dataList = map . get ( t . id ( ) ) ; if ( ( dataList == null ) || ( ( dataList . size ( ) ) < 2 ) ) { continue ; } resolveConflict ( dataList ) ; } } protected void resolveConflict ( List < ParserComposition2 . TokenModificationData > dataList ) { } protected void resolveConflictPrecisely ( List < ParserComposition2 . TokenModificationData > dataList ) { } protected boolean finished ( ) { } public void registerData ( int id , ParserComposition2 . TokenModificationData md ) { } } }

Fix:
for ( IToken t : currentTokensArray ) {