Buggy code:
public class Issue extends BaseIssue implements Persistent { private static final String ISSUE = "Issue" ; protected static final String GET_ISSUE_BY_ID = "getIssueById" ; protected static final String GET_ATTRIBUTE_VALUES_MAP = "getAttributeValuesMap" ; protected static final String GET_ASSOCIATED_USERS = "getAssociatedUsers" ; protected static final String GET_MODULE_ATTRVALUES_MAP = "getModuleAttributeValuesMap" ; protected static final String GET_ATTRVALUE = "getAttributeValue" ; protected static final String GET_ATTRVALUES = "getAttributeValues" ; protected static final String GET_USERS_TO_EMAIL = "getUsersToEmail" ; protected static final String GET_USER_ATTRIBUTEVALUES = "getUserAttributeValues" ; protected static final String GET_CREATED_DATE = "getCreatedDate" ; protected static final String GET_CREATED_BY = "getCreatedBy" ; protected static final String GET_LAST_TRANSACTION = "getLastTransaction" ; protected static final String GET_MODIFIED_BY = "getModifiedBy" ; protected static final String GET_MODIFIED_DATE = "getModifiedDate" ; protected static final String GET_COMMENTS = "getComments" ; protected static final String GET_URLS = "getUrls" ; protected static final String GET_EXISTING_ATTACHMENTS = "getExistingAttachments" ; protected static final String GET_ACTIVITY = "getActivity" ; protected static final String GET_CHILDREN = "getChildren" ; protected static final String GET_PARENTS = "getParents" ; protected static final String GET_ALL_DEPENDENCY_TYPES = "getAllDependencyTypes" ; protected static final String GET_DEPENDENCY = "getDependency" ; protected static final String GET_TEMPLATE_TYPES = "getTemplateTypes" ; protected static final String GET_TEMPLATEINFO = "getTemplateInfo" ; protected static final String GET_CLOSED_DATE = "getClosedDate" ; protected static final String GET_ORPHAN_ATTRIBUTEVALUES_LIST = "getOrphanAttributeValuesList" ; protected static final String GET_DEFAULT_TEXT_ATTRIBUTEVALUE = "getDefaultTextAttributeValue" ; protected static final String GET_DEFAULT_TEXT = "getDefaultText" ; Issue ( ) { } protected Issue ( Module module , IssueType issueType ) throws Exception { } public static Issue getNewInstance ( Module module , IssueType issueType ) throws Exception { } public String getUniqueId ( ) throws TorqueException { } public void setUniqueId ( String id ) { } public String getFederatedId ( ) throws TorqueException { } public void setFederatedId ( String id ) { } public static class FederatedId implements Serializable { String domainId ; String prefix ; int count ; public FederatedId ( String id ) { } public FederatedId ( String domain , String prefix , int count ) { } public void setUniqueId ( String id ) { } public String getDomain ( ) { } public String getPrefix ( ) { } public int getCount ( ) { } public void setDomain ( String domainId ) { } public void setPrefix ( String prefix ) { } public void setCount ( int count ) { } } public boolean isTemplate ( ) throws Exception { } public void addComment ( Attachment attachment , ScarabUser user ) throws Exception { } public void addFile ( Attachment attachment ) throws Exception { } public void removeFile ( String index ) throws Exception { } public ScarabModule getScarabModule ( ) { } public void setScarabModule ( ScarabModule module ) { } public void setModule ( Module me ) throws TorqueException { } public Module getModule ( ) throws TorqueException { } public static Issue getIssueById ( String id ) { } public static Issue getIssueById ( Issue . FederatedId fid ) { } public SequencedHashMap getModuleAttributeValuesMap ( ) throws Exception { } public AttributeValue getAttributeValue ( Attribute attribute ) throws Exception { } public List getAttributeValues ( Attribute attribute ) throws Exception { } public boolean isAttributeValue ( AttributeValue attVal ) throws Exception { } public AttributeValue [ ] getOrderedAttributeValues ( ) throws Exception { } private AttributeValue [ ] orderAttributeValues ( Map values , Attribute [ ] attributes ) throws Exception { } public HashMap getAttributeValuesMap ( ) throws Exception { } public HashMap getAllAttributeValuesMap ( ) throws Exception { } public boolean containsMinimumAttributeValues ( ) throws Exception { } public List getEligibleUsers ( Attribute attribute ) throws Exception { } public List getUsersToEmail ( String action ) throws Exception { } public List getAssociatedUsers ( ) throws Exception { <START_BUG> List result = null ; <END_BUG> Object obj = ScarabCache . get ( this , Issue . GET_ASSOCIATED_USERS ) ; if ( obj == null ) { List attributeList = getModule ( ) . getUserAttributes ( getIssueType ( ) , true ) ; List attributeIdList = new ArrayList ( ) ; for ( int i = 0 ; i < ( attributeList . size ( ) ) ; i ++ ) { Attribute att = ( ( Attribute ) ( attributeList . get ( i ) ) ) ; RModuleAttribute modAttr = getModule ( ) . getRModuleAttribute ( att , getIssueType ( ) ) ; if ( modAttr . getActive ( ) ) { attributeIdList . add ( att . getAttributeId ( ) ) ; } } if ( ! ( attributeIdList . isEmpty ( ) ) ) { Criteria crit = new Criteria ( ) . addIn ( ATTRIBUTE_ID , attributeIdList ) . add ( DELETED , false ) ; crit . setDistinct ( ) ; List attValues = getAttributeValues ( crit ) ; for ( int i = 0 ; i < ( attValues . size ( ) ) ; i ++ ) { AttributeValue attVal = ( ( AttributeValue ) ( attValues . get ( i ) ) ) ; ScarabUser su = ScarabUserManager . getInstance ( attVal . getUserId ( ) ) ; result . add ( su ) ; } } ScarabUser createdBy = getCreatedBy ( ) ; if ( ! ( result . contains ( createdBy ) ) ) { result . add ( createdBy ) ; } ScarabCache . put ( result , this , Issue . GET_ASSOCIATED_USERS ) ; } else { result = ( ( List ) ( obj ) ) ; } return result ; } public List getUserAttributeValues ( ) throws Exception { } public Date getCreatedDate ( ) throws Exception { } public ScarabUser getCreatedBy ( ) throws Exception { } public boolean isCreatingUser ( ScarabUser user ) throws Exception { } public Transaction getLastTransaction ( ) throws Exception { } public Date getModifiedDate ( ) throws Exception { } public ScarabUser getModifiedBy ( ) throws Exception { } public boolean isCommentsLong ( ) throws Exception { }

Fix:
List result = new ArrayList ( ) ;