Skip to content

Commit

Permalink
[java] Fix SpotBugs findings in ChromiumDriver and PortProber (#1…
Browse files Browse the repository at this point in the history
…4589)

Co-authored-by: Puja Jagani <[email protected]>
  • Loading branch information
mk868 and pujagani authored Oct 14, 2024
1 parent e9da405 commit c7daf73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion java/src/org/openqa/selenium/chromium/ChromiumDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public ScriptKey pin(String script) {
// Create the actual script we're going to use.
String scriptToUse =
String.format(
"window.seleniumPinnedScript%s = function(){%s}", Math.abs(script.hashCode()), script);
"window.seleniumPinnedScript%s = function(){%s}",
Math.abs((long) script.hashCode()), script);

DevTools devTools = getDevTools();
devTools.createSessionIfThereIsNotOne();
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/net/PortProber.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private static boolean isFree(String bindHost, int port) {
socket.setReuseAddress(true);
socket.bind(new InetSocketAddress(bindHost, port));
return true;
} catch (Exception e) {
} catch (IOException | RuntimeException e) {
return false;
}
}
Expand Down

0 comments on commit c7daf73

Please sign in to comment.