Index: editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java |
=================================================================== |
--- editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java (revision 40507) |
+++ editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java (working copy) |
@@ -228,7 +228,11 @@ |
// call proposal methods |
addUnresolvedProposal_addPart(); |
// done |
- return proposals.toArray(new CorrectionProposal[proposals.size()]); |
+ try { |
+ return proposals.toArray(new CorrectionProposal[proposals.size()]); |
+ } finally { |
+ cleanUp(); |
+ } |
} |
@Override |
@@ -285,6 +289,7 @@ |
return proposals.toArray(new CorrectionProposal[proposals.size()]); |
} finally { |
instrumentation.log(); |
+ cleanUp(); |
} |
} |
@@ -1268,15 +1273,6 @@ |
addUnitCorrectionProposal(QA_SPLIT_VARIABLE_DECLARATION); |
} |
-// private void addLinkedPositionProposal(String group, CorrectionImage icon, String text) { |
-// List<TrackedNodeProposal> nodeProposals = linkedPositionProposals.get(group); |
-// if (nodeProposals == null) { |
-// nodeProposals = Lists.newArrayList(); |
-// linkedPositionProposals.put(group, nodeProposals); |
-// } |
-// nodeProposals.add(new TrackedNodeProposal(icon, text)); |
-// } |
- |
void addProposal_surroundWith() throws Exception { |
// prepare selected statements |
List<Statement> selectedStatements; |
@@ -1545,6 +1541,15 @@ |
} |
} |
+// private void addLinkedPositionProposal(String group, CorrectionImage icon, String text) { |
+// List<TrackedNodeProposal> nodeProposals = linkedPositionProposals.get(group); |
+// if (nodeProposals == null) { |
+// nodeProposals = Lists.newArrayList(); |
+// linkedPositionProposals.put(group, nodeProposals); |
+// } |
+// nodeProposals.add(new TrackedNodeProposal(icon, text)); |
+// } |
+ |
private void addInsertEdit(int offset, String text) { |
textEdits.add(createInsertEdit(offset, text)); |
} |
@@ -1678,6 +1683,24 @@ |
} |
} |
+ private void cleanUp() { |
+ proposals.clear(); |
+ textEdits.clear(); |
+ positionStopEdits.clear(); |
+ linkedPositions.clear(); |
+ linkedPositionProposals.clear(); |
+ assistContext = null; |
+ analysisContext = null; |
+ source = null; |
+ unit = null; |
+ node = null; |
+ unitLibrarySource = null; |
+ unitLibraryElement = null; |
+ unitLibraryFile = null; |
+ unitLibraryFolder = null; |
+ utils = null; |
+ } |
+ |
private Edit createInsertEdit(int offset, String text) { |
return new Edit(offset, 0, text); |
} |