Skip to content

Commit b3e366e

Browse files
mk868VietND96
authored andcommitted
[java] Fix SpotBugs bugs in the Selenium manager (SeleniumHQ#14608)
Co-authored-by: Viet Nguyen Duc <[email protected]>
1 parent 7ec713e commit b3e366e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

java/spotbugs-excludes.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,9 @@
230230
<Bug pattern="NM_CLASS_NAMING_CONVENTION"/>
231231
</Match>
232232

233+
<Match>
234+
<Class name="org.openqa.selenium.manager.SeleniumManager"/>
235+
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
236+
</Match>
237+
233238
</FindBugsFilter>

java/src/org/openqa/selenium/manager/SeleniumManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private synchronized Path getBinary() {
213213
if (!binary.toFile().exists()) {
214214
String binaryPathInJar = String.format("%s/%s%s", folder, SELENIUM_MANAGER, extension);
215215
try (InputStream inputStream = this.getClass().getResourceAsStream(binaryPathInJar)) {
216-
binary.getParent().toFile().mkdirs();
216+
Files.createDirectories(binary.getParent());
217217
Files.copy(inputStream, binary);
218218
}
219219
}

java/src/org/openqa/selenium/manager/SeleniumManagerOutput.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ private static Log fromJson(JsonInput input) {
9898
case "message":
9999
message = input.nextString();
100100
break;
101+
102+
default:
103+
input.skipValue();
104+
break;
101105
}
102106
}
103107
input.endObject();

0 commit comments

Comments
 (0)