Skip to content

Commit

Permalink
[java] Fix SpotBugs bugs in the Selenium manager (SeleniumHQ#14608)
Browse files Browse the repository at this point in the history
Co-authored-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
2 people authored and jkim2492 committed Nov 17, 2024
1 parent 7ec713e commit b3e366e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions java/spotbugs-excludes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,9 @@
<Bug pattern="NM_CLASS_NAMING_CONVENTION"/>
</Match>

<Match>
<Class name="org.openqa.selenium.manager.SeleniumManager"/>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
</Match>

</FindBugsFilter>
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/manager/SeleniumManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private synchronized Path getBinary() {
if (!binary.toFile().exists()) {
String binaryPathInJar = String.format("%s/%s%s", folder, SELENIUM_MANAGER, extension);
try (InputStream inputStream = this.getClass().getResourceAsStream(binaryPathInJar)) {
binary.getParent().toFile().mkdirs();
Files.createDirectories(binary.getParent());
Files.copy(inputStream, binary);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ private static Log fromJson(JsonInput input) {
case "message":
message = input.nextString();
break;

default:
input.skipValue();
break;
}
}
input.endObject();
Expand Down

0 comments on commit b3e366e

Please sign in to comment.