Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions java/src/dev/selenium/tools/modules/ModuleGenerator.java

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use bos.toString(StandardCharsets.UTF_8) with String.format() for correctness, readability, and maintainability.

Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,7 @@ public static void main(String[] args) throws IOException {
}
if (result != 0) {
throw new RuntimeException(
"Unable to process module:\n"
+ "jdeps "
+ String.join(" ", jdepsArgs)
+ "\n"
+ new String(bos.toByteArray()));
"Unable to process module:\n" + "jdeps " + String.join(" ", jdepsArgs) + "\n" + bos);
}

AtomicReference<Path> moduleInfo = new AtomicReference<>();
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public static Platform extractFromSysProperty(String osName, String osVersion) {
String previousMatch = null;
for (Platform os : Platform.values()) {
for (String matcher : os.partOfOsName) {
if ("".equals(matcher)) {
if (matcher.isEmpty()) {
continue;
}
matcher = matcher.toLowerCase(Locale.ENGLISH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public HttpRequest encode(Command command) {
byte[] data = content.getBytes(UTF_8);

request.setHeader(HttpHeader.ContentLength.getName(), String.valueOf(data.length));
request.setHeader(HttpHeader.ContentType.getName(), JSON_UTF_8.toString());
request.setHeader(HttpHeader.ContentType.getName(), JSON_UTF_8);
request.setContent(bytes(data));
}

Expand Down
Loading