Chromium Code Reviews| 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. |
| */ |