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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/MemoryIndexStoreImpl.java

Issue 189433006: Support for DartBlockBody, DartExpressionBody, DartOmit in java2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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.engine/src/com/google/dart/engine/internal/index/MemoryIndexStoreImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/MemoryIndexStoreImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/MemoryIndexStoreImpl.java
index 959bc06c60def2758e033250adfce205bd5bab40..37af92d81a1c6425bb611c6447af8bdb44d4e9a4 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/MemoryIndexStoreImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/MemoryIndexStoreImpl.java
@@ -34,6 +34,9 @@ import com.google.dart.engine.internal.context.InstrumentedAnalysisContextImpl;
import com.google.dart.engine.internal.element.member.Member;
import com.google.dart.engine.source.Source;
import com.google.dart.engine.source.SourceContainer;
+import com.google.dart.engine.utilities.translation.DartBlockBody;
+import com.google.dart.engine.utilities.translation.DartExpressionBody;
+import com.google.dart.engine.utilities.translation.DartOmit;
import java.io.IOException;
import java.io.InputStream;
@@ -339,6 +342,7 @@ public class MemoryIndexStoreImpl implements MemoryIndexStore {
}
@Override
+ @DartOmit
public void readIndex(AnalysisContext context, InputStream input) throws IOException {
context = unwrapContext(context);
new MemoryIndexReader(this, context, input).read();
@@ -518,6 +522,7 @@ public class MemoryIndexStoreImpl implements MemoryIndexStore {
}
@Override
+ @DartOmit
public void writeIndex(AnalysisContext context, OutputStream output) throws IOException {
context = unwrapContext(context);
new MemoryIndexWriter(this, context, output).write();
@@ -526,6 +531,7 @@ public class MemoryIndexStoreImpl implements MemoryIndexStore {
/**
* Creates new {@link Set} that uses object identity instead of equals.
*/
+ @DartExpressionBody("new Set<Location>.identity()")
private Set<Location> createLocationIdentitySet() {
return Sets.newSetFromMap(new IdentityHashMap<Location, Boolean>(4));
}
@@ -547,6 +553,7 @@ public class MemoryIndexStoreImpl implements MemoryIndexStore {
/**
* Checks if given {@link AnalysisContext} is marked as removed.
*/
+ @DartExpressionBody("_removedContexts[context] != null")
private boolean isRemovedContext(AnalysisContext context) {
return removedContexts.containsKey(context);
}
@@ -554,6 +561,7 @@ public class MemoryIndexStoreImpl implements MemoryIndexStore {
/**
* Marks given {@link AnalysisContext} as removed.
*/
+ @DartBlockBody({"_removedContexts[context] = true;"})
Brian Wilkerson 2014/03/07 16:12:31 I don't understand how this is suppose to work. We
scheglov 2014/03/07 22:47:44 Done.
private void markRemovedContext(AnalysisContext context) {
removedContexts.put(context, WEAK_SET_VALUE);
}

Powered by Google App Engine
This is Rietveld 408576698