Buggy code:
public class ScarabRequestTool extends RecyclableSupport implements ScarabRequestScope { private static final String TIME_ZONE = Turbine . getConfiguration ( ) . getString ( "scarab.timezone" ) ; private RunData data ; private ScarabUser user = null ; private Issue issue = null ; private String alert = null ; private Attribute attribute = null ; private Attachment attachment = null ; private Depend depend = null ; private Query query = null ; private IssueTemplateInfo templateInfo = null ; private IssueType issueType = null ; private AttributeGroup group = null ; private Issue reportingIssue = null ; private Module module = null ; private AttributeOption attributeOption = null ; private ROptionOption roo = null ; private ParentChildAttributeOption pcao = null ; private List issueList ; private Report reportGenerator = null ; private int nbrPages = 0 ; private int prevPage = 0 ; private int nextPage = 0 ; private String confirmMessage ; private String infoMessage ; private String alertMessage ; private final TimeZone timezone ; public ScarabRequestTool ( ) { } public void init ( Object data ) { } public void refresh ( ) { } public void setAlert ( String message ) { } public String getAlert ( ) { } public void setAttachment ( Attachment attachment ) { } public void setAttribute ( Attribute attribute ) { } public void setDepend ( Depend depend ) { } public void setQuery ( Query query ) { } private IntakeTool getIntakeTool ( ) { } public ROptionOption getROptionOption ( ) { } public void setROptionOption ( ROptionOption roo ) { } public void setIssueTemplateInfo ( IssueTemplateInfo templateInfo ) { } public void setIssueType ( IssueType issuetype ) { } public ParentChildAttributeOption getParentChildAttributeOption ( ) { } public void setParentChildAttributeOption ( ParentChildAttributeOption roo ) { } public void setAttributeOption ( AttributeOption option ) { } public AttributeOption getAttributeOption ( ) throws Exception { } public void setUser ( ScarabUser user ) { } public ScarabUser getUser ( ) { } public ScarabUser getUser ( Object id ) throws Exception { } public ScarabUser getUserByUserName ( String username ) throws Exception { } public Attribute getAttribute ( ) throws Exception { } public Attribute getAttribute ( NumberKey pk ) throws Exception { } public AttributeOption getAttributeOption ( NumberKey pk ) throws Exception { } public AttributeOption getAttributeOption ( String key ) throws Exception { } public List getRModuleUserAttributes ( ) { } public List getValidIssueListAttributes ( ) { ScarabUser user = ( ( ScarabUser ) ( data . getUser ( ) ) ) ; List result = null ; try { MITList currentList = user . getCurrentMITList ( ) ; if ( currentList != null ) { result = currentList . getCommonAttributes ( ) ; } else { Module module = getCurrentModule ( ) ; IssueType issueType = getCurrentIssueType ( ) ; List rmas = module . getRModuleAttributes ( issueType , true ) ; if ( rmas != null ) { result = new ArrayList ( rmas . size ( ) ) ; Iterator i = rmas . iterator ( ) ; <START_BUG> if ( i . hasNext ( ) ) { <END_BUG> result . add ( ( ( RModuleAttribute ) ( i . next ( ) ) ) . getAttribute ( ) ) ; } } } } catch ( Exception e ) { Log . get ( ) . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>get<seq2seq4repair_space>list<seq2seq4repair_space>attributes" , e ) ; } if ( result == null ) { result = new ArrayList ( ) ; } return result ; } public Query getQuery ( ) throws Exception { } public IssueTemplateInfo getIssueTemplateInfo ( ) throws Exception { } public Issue getIssueTemplate ( ) throws Exception { } public Issue getIssueTemplate ( String templateId ) throws Exception { } public Depend getDepend ( ) throws Exception { } public Attachment getAttachment ( ) throws Exception { } public AttributeGroup getAttributeGroup ( ) throws Exception { } public AttributeGroup getAttributeGroup ( String key ) { } public IssueType getIssueType ( String key ) { } public IssueType getIssueType ( ) throws Exception { } public AttributeValue getNewAttributeValue ( Attribute attribute , Issue issue ) throws Exception { } public RModuleAttribute getRModuleAttribute ( ) throws Exception { } public void setAttributeGroup ( AttributeGroup group ) { } public void setModule ( Module module ) { } public Module getModule ( ) throws Exception { } public Module getModule ( String key ) { } public Module getCurrentModule ( ) { } public IssueType getCurrentIssueType ( ) throws Exception { } public void setCurrentIssueType ( IssueType type ) { } public RModuleIssueType getCurrentRModuleIssueType ( ) { } public String getNextEntryTemplate ( ) { } public String getCurrentTemplate ( ) { } public Issue getReportingIssue ( ) throws Exception { } private void getNewReportingIssue ( ) throws Exception { } public void setReportingIssue ( Issue issue ) { } public void setCurrentModule ( Module me ) { } public void setIssue ( Issue issue ) { } public Issue getIssue ( ) throws Exception { } public Issue getIssueByPk ( String key ) { } public Issue getIssue ( String id ) { } public List getIssues ( ) throws Exception { } public List getIssues ( List issueIds ) throws Exception { } public List getScopes ( ) throws Exception { } public List getFrequencies ( ) throws Exception { } public Intake getConditionalIntake ( String parameter ) throws Exception { } public IssueSearch getSearch ( ) throws Exception { } public Intake parseQuery ( String query ) throws Exception { } public List getIssueTemplates ( ) throws Exception { } public List getPrivateQueries ( ) throws Exception { } public List getGlobalQueries ( ) throws Exception { } public List getQueries ( ) throws Exception { } public List getCurrentSearchResults ( ) throws Exception , ScarabException { } public int getIssuePosInList ( ) throws Exception , ScarabException { } public String getNextIssue ( ) throws Exception , ScarabException { }

Fix:
while ( i . hasNext ( ) ) {