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

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_library_CleanUp.java

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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: dart/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_library_CleanUp.java
diff --git a/dart/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_library_CleanUp.java b/dart/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_library_CleanUp.java
index bff6efe79e5dfef3115903e1fbc07986fd0f9f80..38910881d38b4a624088554c0d9ac2edc69c2be4 100644
--- a/dart/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_library_CleanUp.java
+++ b/dart/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_library_CleanUp.java
@@ -28,15 +28,6 @@ import com.google.dart.tools.core.utilities.general.SourceRangeFactory;
* @coverage dart.editor.ui.cleanup
*/
public class Migrate_1M1_library_CleanUp extends AbstractMigrateCleanUp {
- private static String mapLibraryName(String name) {
- name = StringUtils.removeEnd(name, ".dart");
- name = StringUtils.replace(name, ".", "_");
- name = StringUtils.replace(name, ":", "_");
- name = StringUtils.replace(name, "-", "_");
- name = StringUtils.removeEnd(name, ".dart");
- return name;
- }
-
@Override
protected void createFix() throws Exception {
ensurePartOfDirective();
@@ -61,7 +52,8 @@ public class Migrate_1M1_library_CleanUp extends AbstractMigrateCleanUp {
public Void visitLibraryDirective(DartLibraryDirective node) {
if (node.isObsoleteFormat()) {
String name = node.getLibraryName();
- name = mapLibraryName(name);
+ name = StringUtils.removeEnd(name, ".dart");
+ name = StringUtils.replace(name, ".", "_");
addReplaceEdit(SourceRangeFactory.create(node), "library " + name + ";");
}
return super.visitLibraryDirective(node);
@@ -76,7 +68,6 @@ public class Migrate_1M1_library_CleanUp extends AbstractMigrateCleanUp {
}
return super.visitSourceDirective(node);
}
-
});
}
@@ -91,7 +82,7 @@ public class Migrate_1M1_library_CleanUp extends AbstractMigrateCleanUp {
String libraryName = library.getLibraryDirectiveName();
if (libraryName != null) {
String eol = utils.getEndOfLine();
- String source = "part of " + mapLibraryName(libraryName) + ";" + eol + eol;
+ String source = "part of " + libraryName + ";" + eol + eol;
addReplaceEdit(SourceRangeFactory.forStartLength(0, 0), source);
}
}

Powered by Google App Engine
This is Rietveld 408576698