Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/RecordingErrorListener.java

Issue 16774005: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « no previous file | editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698