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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/Checks.java

Issue 10162026: Report warnings and non-fatal errors for shadowing declaration and usage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks for review comments Created 8 years, 8 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
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/Checks.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/Checks.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/Checks.java
index 01228340dfb61932465e7e4a1d1a3acae54ff3c7..aec66bc80c2c6d886039c0bca91aada64c4eb1e3 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/Checks.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/Checks.java
@@ -13,6 +13,7 @@
*/
package com.google.dart.tools.internal.corext.refactoring;
+import com.google.common.collect.Sets;
import com.google.dart.tools.core.DartCore;
import com.google.dart.tools.core.model.CompilationUnit;
import com.google.dart.tools.core.model.DartConventions;
@@ -30,6 +31,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import java.util.List;
+import java.util.Set;
/**
* This class defines a set of reusable static checks methods.
@@ -122,8 +124,14 @@ public class Checks {
public static RefactoringStatus checkCompileErrorsInAffectedFiles(List<SearchMatch> matches)
throws DartModelException {
RefactoringStatus result = new RefactoringStatus();
+ // prepare unique resources
+ Set<IResource> resources = Sets.newHashSet();
for (SearchMatch match : matches) {
- checkCompileErrorsInAffectedFile(result, match.getElement().getResource());
+ resources.add(match.getElement().getResource());
+ }
+ // add warnings for each resource with compilation error
+ for (IResource resource : resources) {
+ checkCompileErrorsInAffectedFile(result, resource);
}
return result;
}

Powered by Google App Engine
This is Rietveld 408576698