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

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

Issue 10809037: Fix library scan of loose files (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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/AnalysisServer.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/AnalysisServer.java (revision 9776)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/AnalysisServer.java (working copy)
@@ -129,8 +129,7 @@
throw new IllegalArgumentException("Cannot analyze a directory: " + libraryFile);
}
synchronized (libraryFiles) {
- if (!libraryFiles.contains(libraryFile)) {
- libraryFiles.add(libraryFile);
+ if (libraryFiles.add(libraryFile)) {
Brian Wilkerson 2012/07/20 15:22:07 ArrayList.add() always returns true. Did you inten
danrubel 2012/07/20 15:48:08 Good catch! Fixing now in subsequent CL.
// Append analysis task to the end of the queue so that any user requests take precedence
queueAnalyzeContext();
}
@@ -158,8 +157,9 @@
if (file.isFile() || (!file.exists() && DartCore.isDartLikeFileName(file.getName()))) {
synchronized (libraryFiles) {
- libraryFiles.remove(file);
- queueNewTask(new DiscardLibraryTask(this, savedContext, file));
+ if (libraryFiles.remove(file)) {
+ queueNewTask(new DiscardLibraryTask(this, savedContext, file));
+ }
}
return;
}
@@ -314,6 +314,16 @@
}
}
+ /**
+ * Ensure that all libraries have been analyzed by adding an instance of
+ * {@link AnalyzeContextTask} to the end of the queue if it has not already been added.
+ */
+ protected void queueAnalyzeContext() {
+ queue.addLastTask(savedContextAnalysisTask);
+ // Give background thread a chance to run
+ Thread.yield();
+ }
+
EditorLibraryManager getLibraryManager() {
return libraryManager;
}
@@ -330,16 +340,6 @@
}
/**
- * Ensure that all libraries have been analyzed by adding an instance of
- * {@link AnalyzeContextTask} to the end of the queue if it has not already been added.
- */
- void queueAnalyzeContext() {
- queue.addLastTask(savedContextAnalysisTask);
- // Give background thread a chance to run
- Thread.yield();
- }
-
- /**
* Add a priority task to the front of the queue. Should *not* be called by the current task being
* performed... use {@link #queueSubTask(Task)} instead.
*/
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698