Skip to content
Open
Changes from all 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
16 changes: 8 additions & 8 deletions src/io/flutter/logging/FlutterConsoleLogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -186,7 +186,7 @@ public void flushFlutterErrorQueue() {
private static final int errorSeparatorLength = 100;
private static final String errorSeparatorChar = "=";

private static final ArrayList<DiagnosticsNode> emptyList = new ArrayList<>();
private static final List<DiagnosticsNode> emptyList = Collections.emptyList();

/**
* Pretty print the error using the available console syling attributes.
Expand Down Expand Up @@ -257,8 +257,8 @@ private void printTerseNodeProperty(ConsoleView console, String indent, Diagnost
skip = false;
}
else if (property.hasChildren()) {
final CompletableFuture<ArrayList<DiagnosticsNode>> future = property.getChildren();
final ArrayList<DiagnosticsNode> children = future.getNow(emptyList);
final CompletableFuture<List<DiagnosticsNode>> future = property.getChildren();
final List<DiagnosticsNode> children = future.getNow(emptyList);
if (children.stream().noneMatch(DiagnosticsNode::hasChildren)) {
skip = false;
}
Expand Down Expand Up @@ -292,8 +292,8 @@ else if (property.hasChildren()) {
}

if (property.hasChildren()) {
final CompletableFuture<ArrayList<DiagnosticsNode>> future = property.getChildren();
final ArrayList<DiagnosticsNode> children = future.getNow(emptyList);
final CompletableFuture<List<DiagnosticsNode>> future = property.getChildren();
final List<DiagnosticsNode> children = future.getNow(emptyList);

for (DiagnosticsNode child : children) {
printDiagnosticsNodeProperty(console, childIndent, child, contentType, false);
Expand Down Expand Up @@ -342,8 +342,8 @@ private void printDiagnosticsNodeProperty(ConsoleView console, String indent, Di
}

if (property.hasChildren()) {
final CompletableFuture<ArrayList<DiagnosticsNode>> future = property.getChildren();
final ArrayList<DiagnosticsNode> children = future.getNow(emptyList);
final CompletableFuture<List<DiagnosticsNode>> future = property.getChildren();
final List<DiagnosticsNode> children = future.getNow(emptyList);

// Don't collapse children if it's just a flat list of children.
if (!isInChild && children.stream().noneMatch(DiagnosticsNode::hasChildren)) {
Expand Down
Loading