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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java

Issue 189433006: Support for DartBlockBody, DartExpressionBody, DartOmit in java2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. 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/source/FileBasedSource.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
index 8a6067f3f938147c84a016fd9bf8b5cafc7f74a8..9c8f4d18ca890898a18b8fd186ae39113af56224 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
@@ -18,6 +18,8 @@ import com.google.dart.engine.internal.context.PerformanceStatistics;
import com.google.dart.engine.internal.context.TimestampedData;
import com.google.dart.engine.utilities.general.TimeCounter.TimeCounterHandle;
import com.google.dart.engine.utilities.io.FileUtilities;
+import com.google.dart.engine.utilities.translation.DartBlockBody;
+import com.google.dart.engine.utilities.translation.DartOmit;
import java.io.File;
import java.io.FileInputStream;
@@ -54,6 +56,7 @@ public class FileBasedSource implements Source {
/**
* The character set used to decode bytes into characters.
*/
+ @DartOmit
private static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
/**
@@ -99,6 +102,7 @@ public class FileBasedSource implements Source {
}
@Override
+ @DartOmit
public void getContentsToReceiver(ContentReceiver receiver) throws Exception {
TimeCounterHandle handle = PerformanceStatistics.io.start();
try {
@@ -176,6 +180,7 @@ public class FileBasedSource implements Source {
* @throws Exception if the contents of this source could not be accessed
* @see #getContents()
*/
+ @DartBlockBody({"return new TimestampedData<String>(_file.lastModified(), _file.readAsStringSync());"})
protected TimestampedData<CharSequence> getContentsFromFile() throws Exception {
String contents;
long modificationTime = file.lastModified();
@@ -234,6 +239,7 @@ public class FileBasedSource implements Source {
* @throws Exception if the contents of this source could not be accessed
* @see #getContentsToReceiver(ContentReceiver)
*/
+ @DartOmit
protected void getContentsFromFileToReceiver(ContentReceiver receiver) throws Exception {
String contents;
long modificationTime = file.lastModified();

Powered by Google App Engine
This is Rietveld 408576698