| Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/ImportRewriteAnalyzer.java
|
| ===================================================================
|
| --- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/ImportRewriteAnalyzer.java (revision 10597)
|
| +++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/ImportRewriteAnalyzer.java (working copy)
|
| @@ -49,8 +49,8 @@
|
| private IRegion sourceRange;
|
| private int containerNameLength;
|
|
|
| - public DirectiveDeclEntry(int containerNameLength, String elementName, String prefix,
|
| - IRegion sourceRange) {
|
| + public DirectiveDeclEntry(
|
| + int containerNameLength, String elementName, String prefix, IRegion sourceRange) {
|
| this.elementName = elementName;
|
| this.prefix = prefix;
|
| this.sourceRange = sourceRange;
|
| @@ -632,8 +632,8 @@
|
| PackageEntry curr = this.packageEntries.get(i);
|
| if (!curr.isComment()) {
|
| if (groupId == null || groupId.equals(curr.getGroupID())) {
|
| - boolean preferrCurr = (bestMatch == null)
|
| - || (curr.getNumberOfImports() > bestMatch.getNumberOfImports());
|
| + boolean preferrCurr = (bestMatch == null) || (curr.getNumberOfImports()
|
| + > bestMatch.getNumberOfImports());
|
| if (matcher.isBetterMatch(curr.getName(), preferrCurr)) {
|
| bestMatch = curr;
|
| }
|
| @@ -680,10 +680,6 @@
|
| return directive.getLibraryUri().getValue();
|
| }
|
|
|
| - /**
|
| - * @param root
|
| - * @return
|
| - */
|
| private List<DartImportDirective> getImports(DartUnit root) {
|
| List<DartDirective> directives = root.getDirectives();
|
| List<DartImportDirective> imports = new ArrayList<DartImportDirective>();
|
| @@ -712,9 +708,12 @@
|
| return buf.toString();
|
| }
|
|
|
| + @SuppressWarnings("deprecation")
|
| private String getPrefix(DartImportDirective directive) {
|
| if (directive.getPrefix() != null) {
|
| - return directive.getPrefix().toString();
|
| + return directive.getPrefix().getName();
|
| + } else if (directive.getOldPrefix() != null) {
|
| + return directive.getOldPrefix().toString();
|
| }
|
| return null;
|
| }
|
|
|