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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/LibraryScanTask.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
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/LibraryScanTask.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/LibraryScanTask.java (revision 9776)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/LibraryScanTask.java (working copy)
@@ -30,7 +30,8 @@
* Scan the specified folder and all subfolders for Dart libraries. Add any libraries and loose dart
* files found to the {@link AnalysisServer}.
*/
-public class LibraryScanTask extends Task {
+class LibraryScanTask extends Task {
+
private static final long SCAN_BYTE_THRESHOLD = 10 * 1000 * 1024; // 10 MB
private static final long SCAN_TIME_THRESHOLD = 10 * 1000; // ten seconds
@@ -112,8 +113,10 @@
looseFiles.removeAll(lib.getSourceFiles());
for (File sourcedFile : lib.getSourceFiles()) {
Library otherLib = context.getCachedLibrary(sourcedFile);
- if (otherLib != null && !otherLib.hasDirectives()) {
- server.discard(otherLib.getFile());
+ // If there is no information about the sourcedFile currently in the cache
+ // make the assumption that it is not a library file rather than doing more work
+ if (otherLib == null || !otherLib.hasDirectives()) {
+ server.discard(sourcedFile);
}
}
iter.remove();

Powered by Google App Engine
This is Rietveld 408576698