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

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

Issue 10537122: Fix analysis server caching edge case http://code.google.com/p/dart/issues/detail?id=3423 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/Context.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java (revision 8521)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java (working copy)
@@ -19,8 +19,6 @@
import java.io.File;
import java.io.IOException;
-import java.io.LineNumberReader;
-import java.io.PrintWriter;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
@@ -263,9 +261,9 @@
/**
* Reload cached libraries
*/
- void readCache(LineNumberReader reader) throws IOException {
+ void readCache(CacheReader reader) throws IOException {
while (true) {
- String filePath = reader.readLine();
+ String filePath = reader.readString();
if (filePath == null) {
throw new IOException("Expected " + END_CACHE_TAG + " but found EOF");
}
@@ -282,15 +280,15 @@
* Write information for each cached library. Don't include unresolved libraries so that listeners
* will be notified when the cache is reloaded.
*/
- void writeCache(PrintWriter writer) {
+ void writeCache(CacheWriter writer) {
for (Entry<File, Library> entry : libraryCache.entrySet()) {
Library library = entry.getValue();
if (library.hasBeenResolved()) {
- writer.println(entry.getKey().getPath());
+ writer.writeString(entry.getKey().getPath());
library.writeCache(writer);
}
}
- writer.println(END_CACHE_TAG);
+ writer.writeString(END_CACHE_TAG);
}
private Library[] append(Library[] oldArray, Library library) {

Powered by Google App Engine
This is Rietveld 408576698