SHARE
TWEET

Strange java enum bug

a guest Feb 26th, 2012 23 Never
  1. for(Answer ans : assessmentResult.getAnswersAsList()) { //originally stored in a table
  2.     //AnswerStatus stat = ans.getStatus();
  3.     if (ans.getStatus() == AnswerStatus.NOT_ASSESSED) {
  4.         assessed = false;
  5.     }
  6. }
  7.        
  8. ...
  9. if (AnswerStatus.NOT_ASSESSED == ans.getStatus())
  10. ...
  11.        
  12. if (AnswerStatus.NOT_ASSESSED.equals(ans.getStatus()))
  13.        
  14. if (ans.getStatus().equals(AnswerStatus.NOT_ASSESSED))
RAW Paste Data
Top