/** * Method getOriginalAnomaly. * * @param aOriginalReview R4EReview * @param aCurrentAnomaly R4EAnomaly * @return R4EAnomaly */ public static R4EAnomaly getOriginalAnomaly( R4EReview aOriginalReview, R4EAnomaly aCurrentAnomaly) { if ((null != aOriginalReview) && (null != aCurrentAnomaly)) { // Loop through all anomalies and find the one whose R4EID is the same as the currently // imported one final String[] origIdTokens = aCurrentAnomaly .getInfoAtt() .get(R4EUIConstants.POSTPONED_ATTR_ORIG_ANOMALY_ID) .split( R4EUIConstants .SEPARATOR); // First token is user name, second token is sequence number if (null != origIdTokens) { final R4EUser origUser = aOriginalReview.getUsersMap().get(origIdTokens[0]); if (null != origUser) { for (R4EComment anomaly : origUser.getAddedComments()) { if (anomaly instanceof R4EAnomaly) { Integer id = Integer.valueOf(origIdTokens[1]); if (null != id) { if (id.intValue() == anomaly.getId().getSequenceID()) { return (R4EAnomaly) anomaly; } } } } } } } return null; }
/** * Method buildOriginalCommentID. * * @param aOrigComment R4EComment * @return String */ public static String buildOriginalCommentID(R4EComment aOrigComment) { return aOrigComment.getId().getUserID() + aOrigComment.getId().getSequenceID(); }