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

Unified Diff: pkg/analysis_server/lib/src/plugin/result_merger.dart

Issue 2685783005: Finish file rename operation (TBR) (Closed)
Patch Set: Created 3 years, 10 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 | pkg/analysis_server/test/src/plugin/result_merger_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/plugin/result_merger.dart
diff --git a/pkg/analysis_server/lib/src/plugin/result_merger.dart b/pkg/analysis_server/lib/src/plugin/result_merger.dart
index e1de9ca866565c3a1c86b7198c146d4bfe3c0353..b9c28c17ffd72aa519d7da361d310435822255bd 100644
--- a/pkg/analysis_server/lib/src/plugin/result_merger.dart
+++ b/pkg/analysis_server/lib/src/plugin/result_merger.dart
@@ -6,7 +6,7 @@ import 'dart:collection';
import 'package:analysis_server/plugin/protocol/protocol.dart'
hide AnalysisErrorFixes;
-import 'package:analyzer_plugin/protocol/generated_protocol.dart' as plugin;
+import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
import 'package:meta/meta.dart';
/**
@@ -511,6 +511,32 @@ class ResultMerger {
}
/**
+ * Return a list of source changes composed by merging the lists of source
+ * changes in the [partialResultList].
+ *
+ * The resulting list will contain all of the source changes from all of the
+ * plugins. If two or more plugins contribute the same source change the
+ * resulting list will contain duplications.
+ */
+ List<plugin.PrioritizedSourceChange> mergePrioritizedSourceChanges(
+ List<List<plugin.PrioritizedSourceChange>> partialResultList) {
+ int count = partialResultList.length;
+ if (count == 0) {
+ return <plugin.PrioritizedSourceChange>[];
+ } else if (count == 1) {
+ return partialResultList[0];
+ }
+ List<plugin.PrioritizedSourceChange> mergedChanges =
+ <plugin.PrioritizedSourceChange>[];
+ for (List<plugin.PrioritizedSourceChange> partialResults
+ in partialResultList) {
+ mergedChanges.addAll(partialResults);
+ }
+ mergedChanges.sort((first, second) => first.priority - second.priority);
+ return mergedChanges;
+ }
+
+ /**
* Return a refactoring feedback composed by merging the refactoring feedbacks
* in the [partialResultList].
*
@@ -764,30 +790,6 @@ class ResultMerger {
* plugins. If two or more plugins contribute the same source change the
* resulting list will contain duplications.
*/
- List<plugin.PrioritizedSourceChange> mergePrioritizedSourceChanges(
- List<List<plugin.PrioritizedSourceChange>> partialResultList) {
- int count = partialResultList.length;
- if (count == 0) {
- return <plugin.PrioritizedSourceChange>[];
- } else if (count == 1) {
- return partialResultList[0];
- }
- List<plugin.PrioritizedSourceChange> mergedChanges = <plugin.PrioritizedSourceChange>[];
- for (List<plugin.PrioritizedSourceChange> partialResults in partialResultList) {
- mergedChanges.addAll(partialResults);
- }
- mergedChanges.sort((first, second) => first.priority - second.priority);
- return mergedChanges;
- }
-
- /**
- * Return a list of source changes composed by merging the lists of source
- * changes in the [partialResultList].
- *
- * The resulting list will contain all of the source changes from all of the
- * plugins. If two or more plugins contribute the same source change the
- * resulting list will contain duplications.
- */
List<SourceChange> mergeSourceChanges(
List<List<SourceChange>> partialResultList) {
int count = partialResultList.length;
« no previous file with comments | « no previous file | pkg/analysis_server/test/src/plugin/result_merger_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698