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

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

Issue 11665018: Fix for renaming named constructor reference in 'super' invocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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/rename/RenameAnalyzeUtil.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameAnalyzeUtil.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameAnalyzeUtil.java
index 1d7469f11ac548c37c5ca0d7bd63e1f0e48b7348..d27d454a3b3b6c4979de95095fa7846dea4a0314 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameAnalyzeUtil.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameAnalyzeUtil.java
@@ -141,6 +141,7 @@ public class RenameAnalyzeUtil {
unit.getSource(),
range.getOffset(),
SourceRangeUtils.getEnd(range));
+ referenceSource = getSimpleName(referenceSource);
if (!referenceSource.equals(expectedSource)) {
return RefactoringStatus.createFatalErrorStatus(
Messages.format(
@@ -378,6 +379,16 @@ public class RenameAnalyzeUtil {
}
/**
+ * @return the "simple" name, for example "name" for "A.name".
+ */
+ public static String getSimpleName(String name) {
+ if (StringUtils.contains(name, ".")) {
+ return StringUtils.substringAfterLast(name, ".");
+ }
+ return name;
+ }
+
+ /**
* @return all direct and indirect subtypes of the given {@link Type}.
*/
public static List<Type> getSubTypes(Type type) throws CoreException {

Powered by Google App Engine
This is Rietveld 408576698