Buggy code:
public class Issue extends BaseIssue implements Persistent { private static final String ISSUE = "Issue" ; private static final String GET_ISSUE_BY_ID = "getIssueById" ; private static final String GET_ATTRIBUTE_VALUES_MAP = "getAttributeValuesMap" ; private static final String GET_ASSOCIATED_USERS = "getAssociatedUsers" ; private static final String GET_MODULE_ATTRVALUES_MAP = "getModuleAttributeValuesMap" ; private static final String GET_ATTRVALUE = "getAttributeValue" ; private static final String GET_ATTRVALUES = "getAttributeValues" ; private static final String GET_USERS_TO_EMAIL = "getUsersToEmail" ; private static final String GET_USER_ATTRIBUTEVALUES = "getUserAttributeValues" ; private static final String GET_CREATED_DATE = "getCreatedDate" ; private static final String GET_CREATED_BY = "getCreatedBy" ; private static final String GET_MODIFIED_BY = "getModifiedBy" ; private static final String GET_COMMENTS = "getComments" ; private static final String GET_URLS = "getUrls" ; private static final String GET_EXISTING_ATTACHMENTS = "getExistingAttachments" ; private static final String GET_ACTIVITY = "getActivity" ; private static final String GET_CHILDREN = "getChildren" ; private static final String GET_PARENTS = "getParents" ; private static final String GET_ALL_DEPENDENCY_TYPES = "getAllDependencyTypes" ; private static final String GET_DEPENDENCY = "getDependency" ; private static final String GET_TEMPLATE_TYPES = "getTemplateTypes" ; private static final String GET_TEMPLATEINFO = "getTemplateInfo" ; private static final String GET_CLOSED_DATE = "getClosedDate" ; private static final String GET_ORPHAN_ATTRIBUTEVALUES_LIST = "getOrphanAttributeValuesList" ; private static final String GET_DEFAULT_TEXT_ATTRIBUTEVALUE = "getDefaultTextAttributeValue" ; private static final String GET_DEFAULT_TEXT = "getDefaultText" ; Issue ( ) { } protected Issue ( ModuleEntity module , IssueType issueType ) throws Exception { } public static Issue getNewInstance ( ModuleEntity module , IssueType issueType ) throws Exception { } public String getUniqueId ( ) throws TorqueException { } public String getFederatedId ( ) throws TorqueException { if ( ( getIdDomain ( ) ) != null ) { <START_BUG> return ( getIdDomain ( ) ) + ( getUniqueId ( ) ) ; <END_BUG> } return getUniqueId ( ) ; } public void setFederatedId ( String id ) { } public static class FederatedId { 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 ( ModuleEntity me ) throws Exception { } public ModuleEntity getModule ( ) throws TorqueException { } public static Issue getIssueById ( String id ) { } public static Issue getIssueById ( Issue . FederatedId fid ) { } public SequencedHashtable 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 { } public List getUserAttributeValues ( ) throws Exception { } public Date getCreatedDate ( ) throws Exception { } public ScarabUser getCreatedBy ( ) throws Exception { } public ScarabUser getModifiedBy ( ) throws Exception { } public boolean isCommentsLong ( ) throws Exception { } private int getCommentsLimit ( ) throws Exception { } public List getComments ( boolean full ) throws Exception { } public List getUrls ( ) throws Exception { } public List getExistingAttachments ( ) throws Exception { } public int getHistoryLimit ( ) throws Exception { } public boolean isHistoryLong ( ) throws Exception { } public boolean isHistoryLong ( int limit ) throws Exception { } public List getActivity ( ) throws Exception { } public List getActivity ( int limit ) throws Exception { } public List getActivity ( boolean fullHistory ) throws Exception { } private List getActivity ( boolean fullHistory , int limit ) throws Exception { } public List getChildren ( ) throws Exception { } public List getParents ( ) throws Exception { } public List getAllDependencyTypes ( ) throws Exception { } public Depend getDependency ( Issue childIssue ) throws Exception { } public void save ( DBConnection dbCon ) throws TorqueException { } private int getNextIssueId ( DBConnection dbCon ) throws Exception { } private String getIdTableKey ( ) throws Exception { } private void saveIdTableKey ( DBConnection dbCon ) throws Exception { } public static List searchKeywords ( String [ ] keywords , boolean useAnd ) throws Exception { } public List getTemplateTypes ( ) throws Exception { } public IssueTemplateInfo getTemplateInfo ( ) throws Exception { } public Date getClosedDate ( ) throws Exception { } public void addVote ( ScarabUser user ) throws Exception , ScarabException { } public List getMatchingAttributeValuesList ( String moduleId ) throws Exception { } public List getMatchingAttributeValuesList ( NumberKey moduleId ) throws Exception { } public List getOrphanAttributeValuesList ( String moduleId ) throws Exception { } public List getOrphanAttributeValuesList ( NumberKey moduleId ) throws Exception { } public void assignUsers ( List newAssignees , String attachmentText , ScarabUser assigner , Attribute attribute ) throws Exception { }

Fix:
return ( ( getIdDomain ( ) ) + '-' ) + ( getUniqueId ( ) ) ;