Guest User

Untitled

a guest
May 20th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. Exception in thread "Timer-0" java.util.ConcurrentModificationException
  2. at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
  3. at java.util.HashMap$EntryIterator.next(HashMap.java:1471)
  4. at java.util.HashMap$EntryIterator.next(HashMap.java:1469)
  5. at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
  6. at java.util.HashSet.<init>(HashSet.java:119)
  7. at javafx.scene.CssStyleHelper.resetToInitialValues(CssStyleHelper.java:441)
  8. at javafx.scene.CssStyleHelper.createStyleHelper(CssStyleHelper.java:180)
  9. at javafx.scene.Node.reapplyCss(Node.java:8985)
  10. at javafx.scene.Node.reapplyCss(Node.java:9014)
  11. at javafx.scene.Node.impl_reapplyCSS(Node.java:8948)
  12. at javafx.scene.Node$4.invalidated(Node.java:1110)
  13. at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:109)
  14. at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:144)
  15. at javafx.scene.Node$4.set(Node.java:1103)
  16. at javafx.scene.Node$4.set(Node.java:1097)
  17. at javafx.scene.Node.setStyle(Node.java:1075)
  18. at sample.Controller.updateTimerDisplay(Controller.java:66)
  19. at sample.Pomodoro.handleUpdateStatus(Pomodoro.java:68)
  20. at sample.Pomodoro.access$600(Pomodoro.java:8)
  21. at sample.Pomodoro$1.run(Pomodoro.java:56)
  22. at java.util.TimerThread.mainLoop(Timer.java:555)
  23. at java.util.TimerThread.run(Timer.java:505)
  24.  
  25. public void start() {
  26. timer = new Timer();
  27. String soundFile = "./resources/sounds/boxing_bell.wav";
  28. status = State.FOCUSED;
  29. counter = 0;
  30. count = new TimerTask() {
  31. @Override
  32. public void run() {
  33. if(!paused) {
  34. counter++;
  35. displayTimer(controller.getTimer());
  36. }
  37. if(counter == maxSeconds) {
  38. if (status == State.FOCUSED) {
  39. status = State.BREAK;
  40. counter = 0;
  41. maxSeconds = breakTime;
  42. Sound sound = new Sound(soundFile);
  43. sound.playSound();
  44. handleUpdateStatus(status);
  45. } else {
  46. status = State.FOCUSED;
  47. counter = 0;
  48. maxSeconds = focusTime;
  49. Sound sound = new Sound(soundFile);
  50. sound.playSound();
  51. handleUpdateStatus(status);
  52. }
  53. }
  54. }
  55. };
  56. controller.updateTimerDisplay(Controller.Color.BLACK);
  57. timer.scheduleAtFixedRate(count, 1000,1000);
  58. }
Add Comment
Please, Sign In to add comment