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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ResolveLibraryTask.java

Issue 10826047: Replace parsed and resolved maps with cache interface (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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.core/src/com/google/dart/tools/core/analysis/ResolveLibraryTask.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ResolveLibraryTask.java (revision 9990)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ResolveLibraryTask.java (working copy)
@@ -26,7 +26,6 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -63,27 +62,17 @@
if (rootLibrary.getLibraryUnit() != null) {
return;
}
-
- // Collect resolved libraries and parsed units
-
- HashMap<URI, DartUnit> parsedUnits = context.getUnresolvedUnits();
- HashMap<URI, LibraryUnit> resolvedLibs = context.getResolvedLibraries();
ErrorListener errorListener = new ErrorListener(server);
- // Calling #resolve(...) modifies map of parsed units,
- // thus we copy the map to know which units were already parsed before calling resolve
-
- HashSet<URI> parsedUnitURIs = new HashSet<URI>(parsedUnits.keySet());
-
// Resolve
+ SelectiveCacheAdapter selectiveCache = new SelectiveCacheAdapter(context);
Map<URI, LibraryUnit> newlyResolved = resolve(
- server.getLibraryManager(),
rootLibrary.getFile(),
rootLibrary.getLibrarySource(),
- resolvedLibs,
- parsedUnits,
+ selectiveCache,
errorListener);
+ HashSet<URI> parsedUnitURIs = selectiveCache.getParsedUnitURIs();
for (LibraryUnit libUnit : newlyResolved.values()) {
@@ -132,7 +121,7 @@
if (dartFile == null) {
continue;
}
- if (!parsedUnitURIs.contains(dartFile.toURI())) {
+ if (parsedUnitURIs.contains(dartFile.toURI())) {
if (parseEvent == null) {
// Do not report errors during this notification because they will be reported
// as part of the resolution notification

Powered by Google App Engine
This is Rietveld 408576698