Skip to content

Commit

Permalink
[java] Fix SpotBugs bugs in the Selenium manager (#14608)
Browse files Browse the repository at this point in the history
Co-authored-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
mk868 and VietND96 authored Nov 15, 2024
1 parent d55eff3 commit be8fc7e
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 be8fc7e

Please sign in to comment.