Copy should be a copy
@@ -62,9 +62,8 @@ public synchronized void processQueue(
Predicate<RequestHandler> handlerConsumer,
Prioritizer prioritizer) {
- List<RequestHandler> copy = newSessionRequests;
+ List<RequestHandler> copy = new ArrayList<>(newSessionRequests);
if (prioritizer != null) {
- copy = new ArrayList<>(newSessionRequests);
copy.sort((a,b) -> prioritizer.compareTo(
a.getRequest().getDesiredCapabilities(), b.getRequest().getDesiredCapabilities()));
}
