Skip to content

Commit 5090a0c

Browse files
asashourbarancev
authored andcommitted
Use String.valueOf()
This has a slightly better performance since there is no BuildBuffer construction Signed-off-by: Alexei Barantsev <[email protected]>
1 parent 87b1ef3 commit 5090a0c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

java/client/src/org/openqa/selenium/os/ProcessUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private static int killWinProcess(Process process) {
124124
int exitValue;
125125

126126
try {
127-
killPID("" + getProcessId(process));
127+
killPID(String.valueOf(getProcessId(process)));
128128
exitValue = waitForProcessDeath(process, 10000);
129129
} catch (Exception ex) {
130130
LOG.log(Level.WARNING, "Process refused to die after 10 seconds, and couldn't taskkill it", ex);

java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ protected void log(SessionId sessionId, String commandName, Object toLog, When w
679679
if (!logger.isLoggable(level)) {
680680
return;
681681
}
682-
String text = "" + toLog;
682+
String text = String.valueOf(toLog);
683683
if (commandName.equals(DriverCommand.EXECUTE_SCRIPT)
684684
|| commandName.equals(DriverCommand.EXECUTE_ASYNC_SCRIPT)) {
685685
if (text.length() > 100 && Boolean.getBoolean("webdriver.remote.shorten_log_messages")) {

java/client/test/org/openqa/selenium/TypingTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ public void testChordReveseShiftHomeSelectionDeletes() {
505505
element.sendKeys("done" + Keys.HOME);
506506
assertThat(element.getAttribute("value"), is("done"));
507507

508-
element.sendKeys("" + Keys.SHIFT + "ALL " + Keys.HOME);
508+
element.sendKeys(Keys.SHIFT + "ALL " + Keys.HOME);
509509
assertThat(element.getAttribute("value"), is("ALL done"));
510510

511511
element.sendKeys(Keys.DELETE);
@@ -516,7 +516,7 @@ public void testChordReveseShiftHomeSelectionDeletes() {
516516
assertThat( // Note: trailing SHIFT up here
517517
result.getText().trim(), containsString(" up: 16"));
518518

519-
element.sendKeys("" + Keys.DELETE);
519+
element.sendKeys(Keys.DELETE);
520520
assertThat(element.getAttribute("value"), is(""));
521521
}
522522

0 commit comments

Comments
 (0)