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

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

Issue 10837119: Fix for http://code.google.com/p/dart/issues/detail?id=3155 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/LibraryScanTask.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/FileChangedTask.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/FileChangedTask.java (revision 10235)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/FileChangedTask.java (working copy)
@@ -14,6 +14,7 @@
package com.google.dart.tools.core.analysis;
import java.io.File;
+import java.util.Collection;
/**
* Update the model given that that specified file has changed
@@ -52,8 +53,17 @@
// Discard and re-analyze only if this library is not already up to date
if (file.lastModified() != library.lastModified(file)) {
task = new LibraryScanTask(server, context, file, true);
- task.addFilesToScan(library.getSourceFiles());
+ // Discard and scan any libraries that were incorrectly sourced
+ Collection<File> sourceFiles = library.getSourceFiles();
+ task.addFilesToScan(sourceFiles);
+ for (File sourceFile : sourceFiles) {
+ Library sourcedLibrary = context.getCachedLibrary(sourceFile);
+ if (sourcedLibrary != null) {
+ context.discardLibrary(sourcedLibrary);
+ }
+ }
+
// Discard the library and any downstream libraries
context.discardLibraryAndReferencingLibraries(library);
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/LibraryScanTask.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698