Commit fe1d815f authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1051: Prevent ConcurrentModificationException

The unmodifiable collection in the original code is not immutable: when
the original collection is modified, this is reflected (which can cause
problems in iterators created from the unmodifiable collection). This
commit creates a new collection to prevent this from happening.
parent 54f0bc03
......@@ -198,7 +198,7 @@ public class PluginManager {
* @return a Collection of all installed plugins.
*/
public Collection<Plugin> getPlugins() {
return Collections.unmodifiableCollection(plugins.values());
return Collections.unmodifiableCollection(Arrays.asList( plugins.values().toArray( new Plugin[ plugins.size() ]) ));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment