Skip to content

Commit c7daf73

Browse files
mk868pujagani
andauthored
[java] Fix SpotBugs findings in ChromiumDriver and PortProber (SeleniumHQ#14589)
Co-authored-by: Puja Jagani <[email protected]>
1 parent e9da405 commit c7daf73

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

java/src/org/openqa/selenium/chromium/ChromiumDriver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ public ScriptKey pin(String script) {
212212
// Create the actual script we're going to use.
213213
String scriptToUse =
214214
String.format(
215-
"window.seleniumPinnedScript%s = function(){%s}", Math.abs(script.hashCode()), script);
215+
"window.seleniumPinnedScript%s = function(){%s}",
216+
Math.abs((long) script.hashCode()), script);
216217

217218
DevTools devTools = getDevTools();
218219
devTools.createSessionIfThereIsNotOne();

java/src/org/openqa/selenium/net/PortProber.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private static boolean isFree(String bindHost, int port) {
119119
socket.setReuseAddress(true);
120120
socket.bind(new InetSocketAddress(bindHost, port));
121121
return true;
122-
} catch (Exception e) {
122+
} catch (IOException | RuntimeException e) {
123123
return false;
124124
}
125125
}

0 commit comments

Comments
 (0)