FULL PRODUCT VERSION :
1.8.0u66
ADDITIONAL OS VERSION INFORMATION :
OSX 10.11.2
A DESCRIPTION OF THE PROBLEM :
MediaView.setMediaPlayer(...) called multiple times fill cause ConcurrentModificationException.
The JavaFx code is modifying an an underlaying collection whilst iterating over. Although synchronized in each case, the issue is being caused on same thread. should be removing via collection iterator NOT the collection itself. issue in multiple places within MediaPlayer
...
void removeView(MediaView view) {
synchronized (viewRefs) {
for (WeakReference<MediaView> vref : viewRefs) {
MediaView v = vref.get();
if (v != null && v.equals(view)) {
viewRefs.remove(vref);
}
}
}
}
...
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create MediaView
call setMedia with new MediaPlayer
multiple times as in case of Next track function
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
excpecting next media item to play
ACTUAL -
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
at java.util.HashMap$KeyIterator.next(HashMap.java:1453)
at javafx.scene.media.MediaPlayer.removeView(MediaPlayer.java:1712)
at javafx.scene.media.MediaView$1.invalidated(MediaView.java:355)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
at javafx.scene.media.MediaView.setMediaPlayer(MediaView.java:328)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
at java.util.HashMap$KeyIterator.next(HashMap.java:1453)
at javafx.scene.media.MediaPlayer.removeView(MediaPlayer.java:1712)
at javafx.scene.media.MediaView$1.invalidated(MediaView.java:355)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
at javafx.scene.media.MediaView.setMediaPlayer(MediaView.java:328)
REPRODUCIBILITY :
This bug can be reproduced always.
1.8.0u66
ADDITIONAL OS VERSION INFORMATION :
OSX 10.11.2
A DESCRIPTION OF THE PROBLEM :
MediaView.setMediaPlayer(...) called multiple times fill cause ConcurrentModificationException.
The JavaFx code is modifying an an underlaying collection whilst iterating over. Although synchronized in each case, the issue is being caused on same thread. should be removing via collection iterator NOT the collection itself. issue in multiple places within MediaPlayer
...
void removeView(MediaView view) {
synchronized (viewRefs) {
for (WeakReference<MediaView> vref : viewRefs) {
MediaView v = vref.get();
if (v != null && v.equals(view)) {
viewRefs.remove(vref);
}
}
}
}
...
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create MediaView
call setMedia with new MediaPlayer
multiple times as in case of Next track function
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
excpecting next media item to play
ACTUAL -
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
at java.util.HashMap$KeyIterator.next(HashMap.java:1453)
at javafx.scene.media.MediaPlayer.removeView(MediaPlayer.java:1712)
at javafx.scene.media.MediaView$1.invalidated(MediaView.java:355)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
at javafx.scene.media.MediaView.setMediaPlayer(MediaView.java:328)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
at java.util.HashMap$KeyIterator.next(HashMap.java:1453)
at javafx.scene.media.MediaPlayer.removeView(MediaPlayer.java:1712)
at javafx.scene.media.MediaView$1.invalidated(MediaView.java:355)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
at javafx.scene.media.MediaView.setMediaPlayer(MediaView.java:328)
REPRODUCIBILITY :
This bug can be reproduced always.