From ef1b4221b299dfce1215411f69b99fb76bb1807c Mon Sep 17 00:00:00 2001 From: Puja Jagani Date: Fri, 23 Aug 2024 18:43:01 +0530 Subject: [PATCH] [java] Use the return value of the updated "se" prefixed caps --- .../node/config/DriverServiceSessionFactory.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/java/src/org/openqa/selenium/grid/node/config/DriverServiceSessionFactory.java b/java/src/org/openqa/selenium/grid/node/config/DriverServiceSessionFactory.java index a70817d6654a2..5b062434485aa 100644 --- a/java/src/org/openqa/selenium/grid/node/config/DriverServiceSessionFactory.java +++ b/java/src/org/openqa/selenium/grid/node/config/DriverServiceSessionFactory.java @@ -308,12 +308,13 @@ private Capabilities readPrefixedCaps(Capabilities requestedCaps, Capabilities r Map requestedCapsMap = requestedCaps.asMap(); Map returnedCapsMap = returnedCaps.asMap(); - requestedCapsMap.forEach( - (k, v) -> { - if (k.startsWith("se:") && !returnedCapsMap.containsKey(k)) { - returnPrefixedCaps.setCapability(k, v); - } - }); + for (Map.Entry entry : requestedCapsMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + if (key.startsWith("se:") && !returnedCapsMap.containsKey(key)) { + returnPrefixedCaps = returnPrefixedCaps.setCapability(key, value); + } + } return returnPrefixedCaps; }