| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/RecordingErrorListener.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/RecordingErrorListener.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/RecordingErrorListener.java
|
| index e865e39dfd8097e44d147c2a4a34b6e828abe332..40e6bfb6646e76493f92e5284e3adfe33a3c591e 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/RecordingErrorListener.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/RecordingErrorListener.java
|
| @@ -20,11 +20,11 @@ import com.google.dart.engine.source.Source;
|
| import static com.google.dart.engine.error.AnalysisError.NO_ERRORS;
|
|
|
| import java.util.ArrayList;
|
| +import java.util.Collection;
|
| import java.util.HashMap;
|
| import java.util.List;
|
| import java.util.Map;
|
| import java.util.Map.Entry;
|
| -import java.util.Set;
|
|
|
| /**
|
| * Instances of the class {@code RecordingErrorListener} implement an error listener that will
|
| @@ -57,11 +57,12 @@ public class RecordingErrorListener implements AnalysisErrorListener {
|
| * @return an array of errors (not {@code null}, contains no {@code null}s)
|
| */
|
| public AnalysisError[] getErrors() {
|
| - Set<Entry<Source, List<AnalysisError>>> entrySet = errors.entrySet();
|
| - if (entrySet.size() == 0) {
|
| + Collection<Entry<Source, List<AnalysisError>>> entrySet = errors.entrySet();
|
| + int numEntries = entrySet.size();
|
| + if (numEntries == 0) {
|
| return NO_ERRORS;
|
| }
|
| - ArrayList<AnalysisError> resultList = new ArrayList<AnalysisError>(entrySet.size());
|
| + ArrayList<AnalysisError> resultList = new ArrayList<AnalysisError>(numEntries);
|
| for (Entry<Source, List<AnalysisError>> entry : entrySet) {
|
| resultList.addAll(entry.getValue());
|
| }
|
|
|