Skip to content

Commit bd022f4

Browse files
committed
Refactoring, less guava, more standard JDK
1 parent 4561d85 commit bd022f4

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

java/client/src/org/openqa/selenium/logging/HandlerBasedLocalLogs.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
package org.openqa.selenium.logging;
1919

2020
import com.google.common.collect.ImmutableSet;
21-
import com.google.common.collect.Lists;
2221

22+
import java.util.Collections;
2323
import java.util.List;
2424
import java.util.Set;
2525

2626
/**
2727
* LocalLogs instance that extracts entries from a logging handler.
2828
*/
2929
class HandlerBasedLocalLogs extends LocalLogs {
30-
final LoggingHandler loggingHandler;
31-
final Set<String> logTypesToInclude;
30+
private final LoggingHandler loggingHandler;
31+
private final Set<String> logTypesToInclude;
3232

3333
protected HandlerBasedLocalLogs(LoggingHandler loggingHandler, Set<String> logTypesToInclude) {
3434
super();
@@ -42,11 +42,11 @@ public LogEntries get(String logType) {
4242
loggingHandler.flush();
4343
return new LogEntries(entries);
4444
}
45-
return new LogEntries(Lists.<LogEntry>newArrayList());
45+
return new LogEntries(Collections.emptyList());
4646
}
4747

4848
public Set<String> getAvailableLogTypes() {
49-
return ImmutableSet.<String>of(LogType.CLIENT);
49+
return ImmutableSet.of(LogType.CLIENT);
5050
}
5151

5252
public void addEntry(String logType, LogEntry entry) {

java/client/src/org/openqa/selenium/logging/LocalLogs.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
package org.openqa.selenium.logging;
1919

20-
import com.google.common.collect.ImmutableList;
21-
import com.google.common.collect.ImmutableSet;
22-
20+
import java.util.Collections;
2321
import java.util.Set;
2422

2523
/**
@@ -29,11 +27,11 @@ public abstract class LocalLogs implements Logs {
2927

3028
private static final LocalLogs NULL_LOGGER = new LocalLogs() {
3129
public LogEntries get(String logType) {
32-
return new LogEntries(ImmutableList.<LogEntry>of());
30+
return new LogEntries(Collections.emptyList());
3331
}
3432

3533
public Set<String> getAvailableLogTypes() {
36-
return ImmutableSet.of();
34+
return Collections.emptySet();
3735
}
3836

3937
public void addEntry(String logType, LogEntry entry) {

java/client/src/org/openqa/selenium/logging/SessionLogs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public SessionLogs() {
4040

4141
public LogEntries getLogs(String logType) {
4242
if (logType == null || !logTypeToEntriesMap.containsKey(logType)) {
43-
return new LogEntries(Collections.<LogEntry>emptyList());
43+
return new LogEntries(Collections.emptyList());
4444
}
4545
return logTypeToEntriesMap.get(logType);
4646
}

0 commit comments

Comments
 (0)