Skip to content

Commit

Permalink
[java] Use the return value of the updated "se" prefixed caps
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani committed Aug 23, 2024
1 parent 280a076 commit ef1b422
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,13 @@ private Capabilities readPrefixedCaps(Capabilities requestedCaps, Capabilities r
Map<String, Object> requestedCapsMap = requestedCaps.asMap();
Map<String, Object> returnedCapsMap = returnedCaps.asMap();

requestedCapsMap.forEach(
(k, v) -> {
if (k.startsWith("se:") && !returnedCapsMap.containsKey(k)) {
returnPrefixedCaps.setCapability(k, v);
}
});
for (Map.Entry<String, Object> 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;
}
Expand Down

0 comments on commit ef1b422

Please sign in to comment.