Skip to content

Commit

Permalink
[java] Fix SpotBugs bugs in SeleniumManager
Browse files Browse the repository at this point in the history
  • Loading branch information
mk868 committed Oct 22, 2024
1 parent c145a83 commit 675447a
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 @@ -209,7 +209,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 675447a

Please sign in to comment.