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

Unified Diff: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineSemanticProcessor.java

Issue 24481002: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineSemanticProcessor.java
diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineSemanticProcessor.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineSemanticProcessor.java
index 1c09d2faeec74b71204ada3f64b8cce7daeed49b..273bd8a1ee0d1e809380a8d4fe85fa9c8e566dcc 100644
--- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineSemanticProcessor.java
+++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/engine/EngineSemanticProcessor.java
@@ -64,22 +64,16 @@ import static com.google.dart.java2dart.util.ASTFactory.formalParameterList;
import static com.google.dart.java2dart.util.ASTFactory.functionDeclaration;
import static com.google.dart.java2dart.util.ASTFactory.functionExpression;
import static com.google.dart.java2dart.util.ASTFactory.identifier;
-import static com.google.dart.java2dart.util.ASTFactory.ifStatement;
import static com.google.dart.java2dart.util.ASTFactory.integer;
import static com.google.dart.java2dart.util.ASTFactory.methodDeclaration;
import static com.google.dart.java2dart.util.ASTFactory.methodInvocation;
import static com.google.dart.java2dart.util.ASTFactory.namedFormalParameter;
-import static com.google.dart.java2dart.util.ASTFactory.nullLiteral;
import static com.google.dart.java2dart.util.ASTFactory.prefixExpression;
import static com.google.dart.java2dart.util.ASTFactory.propertyAccess;
import static com.google.dart.java2dart.util.ASTFactory.redirectingConstructorInvocation;
-import static com.google.dart.java2dart.util.ASTFactory.returnStatement;
import static com.google.dart.java2dart.util.ASTFactory.simpleFormalParameter;
-import static com.google.dart.java2dart.util.ASTFactory.thisExpression;
import static com.google.dart.java2dart.util.ASTFactory.typeName;
import static com.google.dart.java2dart.util.ASTFactory.variableDeclaration;
-import static com.google.dart.java2dart.util.ASTFactory.variableDeclarationList;
-import static com.google.dart.java2dart.util.ASTFactory.variableDeclarationStatement;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
@@ -608,42 +602,18 @@ public class EngineSemanticProcessor extends SemanticProcessor {
node.setBody(blockFunctionBody());
return null;
}
- if (isMethodInClass(binding, "getContents", "com.google.dart.engine.source.FileBasedSource")) {
+ if (isMethodInClass(
+ binding,
+ "getContentsFromFile",
+ "com.google.dart.engine.source.FileBasedSource")) {
SimpleIdentifier receiverIdent = node.getParameters().getParameters().get(0).getIdentifier();
Block tryCacheBlock = block();
- {
- tryCacheBlock.getStatements().add(
- variableDeclarationStatement(variableDeclarationList(
- null,
- typeName("String"),
- variableDeclaration(
- "contents",
- methodInvocation(
- identifier("_contentCache"),
- "getContents",
- thisExpression())))));
- SimpleIdentifier contentsIdent = identifier("contents");
- Expression modificationStampExpr = methodInvocation(
- identifier("_contentCache"),
- "getModificationStamp",
- thisExpression());
- tryCacheBlock.getStatements().add(
- ifStatement(
- binaryExpression(contentsIdent, TokenType.BANG_EQ, nullLiteral()),
- block(
- expressionStatement(methodInvocation(
- receiverIdent,
- "accept2",
- contentsIdent,
- modificationStampExpr)),
- returnStatement())));
- }
- ExpressionStatement doReadStatement = expressionStatement(methodInvocation(
+ ExpressionStatement statement = expressionStatement(methodInvocation(
receiverIdent,
"accept2",
methodInvocation(identifier("file"), "readAsStringSync"),
methodInvocation(identifier("file"), "lastModified")));
- node.setBody(blockFunctionBody(tryCacheBlock, doReadStatement));
+ node.setBody(blockFunctionBody(tryCacheBlock, statement));
return null;
}
return null;

Powered by Google App Engine
This is Rietveld 408576698