private boolean updateComments(List<Comment> commentList) throws Exception {
if (commentList == null || commentList.isEmpty())
return true;
Comment existingComment;
List<Comment> subCommentList = null;
for (Comment comment : commentList) {
existingComment = ReviewCacheManager.$.getComment(comment.getProject(), comment.getId());
if (existingComment != null) {
existingComment = (Comment)Utils.deepClone(existingComment); // Make a copy of it
if (comment.getContent() != null)
existingComment.setContent(comment.getContent());
if (comment.getPageState() != null)
existingComment.setPageState(comment.getPageState());
if (comment.getPageStateList() != null)
existingComment.setPageStateList(comment.getPageStateList());
if (comment.getViewScene() != null)
existingComment.setViewScene(comment.getViewScene());
if (comment.getViewSceneList() != null)
existingComment.setViewSceneList(comment.getViewSceneList());
if (comment.getSubject() != null)
existingComment.setSubject(comment.getSubject());
if (comment.getDrawingJson() != null)
existingComment.setDrawingJson(comment.getDrawingJson());
if(null == subCommentList){
subCommentList = new ArrayList<Comment>();
}
subCommentList.add(existingComment);
ReviewCacheManager.$.updateComments(subCommentList);