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

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

Issue 10939027: Issue 5116. Support both 'dynamic' and 'Dynamic' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use DartParser.DYNAMIC_KEYWORD Created 8 years, 3 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/code/ExtractUtils.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
index 278fc0fdbb6a9f3a8d8c3b2d4a3a2d0d0919ca5e..4e45a81b4a0f164946a84697af3dfccd735c7f34 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
@@ -23,6 +23,7 @@ import com.google.dart.compiler.ast.DartStatement;
import com.google.dart.compiler.ast.DartUnit;
import com.google.dart.compiler.common.HasSourceInfo;
import com.google.dart.compiler.common.SourceInfo;
+import com.google.dart.compiler.parser.DartParser;
import com.google.dart.compiler.parser.DartScanner;
import com.google.dart.compiler.parser.Token;
import com.google.dart.compiler.type.Type;
@@ -108,7 +109,10 @@ public class ExtractUtils {
}
Type type = expression.getType();
String typeSource = getTypeSource(type);
- if ("Dynamic".equals(typeSource)) {
+ if ("dynamic".equals(typeSource)) {
+ return null;
+ }
+ if (DartParser.DYNAMIC_KEYWORD_DEPRECATED.equals(typeSource)) {
return null;
}
return typeSource;
@@ -119,8 +123,14 @@ public class ExtractUtils {
*/
public static String getTypeSource(Type type) {
String typeSource = type.toString();
- typeSource = StringUtils.replace(typeSource, "<Dynamic>", "");
- typeSource = StringUtils.replace(typeSource, "<Dynamic, Dynamic>", "");
+ typeSource = StringUtils.replace(typeSource, "<dynamic>", "");
+ typeSource = StringUtils.replace(typeSource, "<dynamic, dynamic>", "");
+ typeSource = StringUtils.replace(
+ typeSource,
+ "<" + DartParser.DYNAMIC_KEYWORD_DEPRECATED + ">",
+ "");
+ typeSource = StringUtils.replace(typeSource, "<" + DartParser.DYNAMIC_KEYWORD_DEPRECATED + ", "
+ + DartParser.DYNAMIC_KEYWORD_DEPRECATED + ">", "");
return typeSource;
}

Powered by Google App Engine
This is Rietveld 408576698