Index: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java |
diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java |
index efea9757fc47b07a7a2e3e292ef0da796cffb693..67c65e716affa999c690d4d09d7f961ed00f4a90 100644 |
--- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java |
+++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java |
@@ -620,6 +620,27 @@ public class Context { |
return references != null ? references : Lists.<SimpleIdentifier> newArrayList(); |
} |
+ /** |
+ * Remembers that "identifier" is reference to the given Java binding. |
+ */ |
+ public void putReference(SimpleIdentifier identifier, IBinding binding, String bindingSignature) { |
+ if (binding != null) { |
+ signatureToBinding.put(bindingSignature, binding); |
+ identifierToName.put(identifier, identifier.getName()); |
+ // remember binding for reference |
+ nodeToBinding.put(identifier, binding); |
+ // add reference to binding |
+ List<SimpleIdentifier> identifiers = bindingToIdentifiers.get(binding); |
+ if (identifiers == null) { |
+ identifiers = Lists.newLinkedList(); |
+ bindingToIdentifiers.put(binding, identifiers); |
+ } |
+ identifiers.add(identifier); |
+ } |
+ // remember global name |
+ usedNames.add(identifier.getName()); |
+ } |
+ |
public void renameConstructor(ConstructorDeclaration node, String name) { |
IMethodBinding binding = constructorToBinding.get(node); |
// |
@@ -773,27 +794,6 @@ public class Context { |
privateClassMembers.add(member); |
} |
- /** |
- * Remembers that "identifier" is reference to the given Java binding. |
- */ |
- void putReference(SimpleIdentifier identifier, IBinding binding, String bindingSignature) { |
- if (binding != null) { |
- signatureToBinding.put(bindingSignature, binding); |
- identifierToName.put(identifier, identifier.getName()); |
- // remember binding for reference |
- nodeToBinding.put(identifier, binding); |
- // add reference to binding |
- List<SimpleIdentifier> identifiers = bindingToIdentifiers.get(binding); |
- if (identifiers == null) { |
- identifiers = Lists.newLinkedList(); |
- bindingToIdentifiers.put(binding, identifiers); |
- } |
- identifiers.add(identifier); |
- } |
- // remember global name |
- usedNames.add(identifier.getName()); |
- } |
- |
private void dontUseThisInFieldInitializers(CompilationUnit unit) { |
unit.accept(new RecursiveASTVisitor<Void>() { |
@Override |