No logical changes: Use Java 8 instead of guava
package org.openqa.selenium.logging;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
* of logs, such as for profiling.
*/
class StoringLocalLogs extends LocalLogs {
- private final Map<String, List<LogEntry>> localLogs = Maps.newHashMap();
+ private final Map<String, List<LogEntry>> localLogs = new HashMap<>();
private final Set<String> logTypesToInclude;
public StoringLocalLogs(Set<String> logTypesToInclude) {
@@ -43,11 +42,11 @@ public LogEntries get(String logType) {
private Iterable<LogEntry> getLocalLogs(String logType) {
if (localLogs.containsKey(logType)) {
List<LogEntry> entries = localLogs.get(logType);
- localLogs.put(logType, Lists.<LogEntry>newArrayList());
+ localLogs.put(logType, new ArrayList<>());
return entries;
}
- return Lists.newArrayList();
+ return new ArrayList<>();
}
/**
@@ -62,7 +61,7 @@ public void addEntry(String logType, LogEntry entry) {
}
if (!localLogs.containsKey(logType)) {
- localLogs.put(logType, Lists.newArrayList(entry));
+ localLogs.put(logType, new ArrayList<>());
} else {
localLogs.get(logType).add(entry);
}
