Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Strange java enum bug

By: a guest on Feb 26th, 2012  |  syntax: None  |  size: 0.39 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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))