Skip to content

Commit c4ca319

Browse files
committed
[java] Fix SpotBugs bugs in SeleniumManager
1 parent edff2f3 commit c4ca319

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

java/spotbugs-excludes.xml

+5
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private synchronized Path getBinary() {
209209
if (!binary.toFile().exists()) {
210210
String binaryPathInJar = String.format("%s/%s%s", folder, SELENIUM_MANAGER, extension);
211211
try (InputStream inputStream = this.getClass().getResourceAsStream(binaryPathInJar)) {
212-
binary.getParent().toFile().mkdirs();
212+
Files.createDirectories(binary.getParent());
213213
Files.copy(inputStream, binary);
214214
}
215215
}

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

+4
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)