Skip to content

Commit 7ccce73

Browse files
committed
fix appeal resolve check
1 parent 51f5d7f commit 7ccce73

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

src/main/java/com/topcoder/onlinereview/component/project/phase/handler/AppealsResponsePhaseHandler.java

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -357,43 +357,28 @@ private boolean allAppealsResolved(Phase phase) throws PhaseHandlingException {
357357

358358
// for each review
359359
for (Review review : reviews) {
360-
int appealCount = 0;
361-
int responseCount = 0;
362-
363-
Comment[] comments = review.getAllComments();
364-
365-
for (Comment comment : comments) {
366-
String commentType = comment.getCommentType().getName();
367-
368-
if (Constants.COMMENT_TYPE_APPEAL.equals(commentType)) {
369-
appealCount++;
370-
} else if (Constants.COMMENT_TYPE_APPEAL_RESPONSE.equals(commentType)) {
371-
responseCount++;
372-
}
373-
}
374360

375361
Item[] items = review.getAllItems();
376362

377363
for (Item item : items) {
378-
comments = item.getAllComments();
364+
boolean appeal = false;
365+
boolean response = false;
366+
Comment[] comments = item.getAllComments();
379367

380368
for (Comment comment : comments) {
381369
String commentType = comment.getCommentType().getName();
382370

383371
if (Constants.COMMENT_TYPE_APPEAL.equals(commentType)) {
384-
appealCount++;
372+
appeal = true;
385373
} else if (Constants.COMMENT_TYPE_APPEAL_RESPONSE.equals(commentType)) {
386-
responseCount++;
374+
response = true;
387375
}
388376
}
389-
}
390-
391-
// if appeals count does not match response count, return false.
392-
if (appealCount != responseCount) {
393-
return false;
377+
if (appeal && !response) {
378+
return false;
379+
}
394380
}
395381
}
396-
397382
return true;
398383
}
399384
}

0 commit comments

Comments
 (0)