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

Unified Diff: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/GuavaSemanticProcessor.java

Issue 128443003: Analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 6 years, 11 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/processor/GuavaSemanticProcessor.java
diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/GuavaSemanticProcessor.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/GuavaSemanticProcessor.java
index 25698e35617619bafb12154fe03f9d870d468475..e4d3026238b3a53410f87ef42b4ca7137c25d884 100644
--- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/GuavaSemanticProcessor.java
+++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/GuavaSemanticProcessor.java
@@ -24,6 +24,8 @@ import com.google.dart.java2dart.Context;
import static com.google.dart.java2dart.util.ASTFactory.binaryExpression;
import static com.google.dart.java2dart.util.ASTFactory.instanceCreationExpression;
+import static com.google.dart.java2dart.util.ASTFactory.listLiteral;
+import static com.google.dart.java2dart.util.ASTFactory.mapLiteral;
import static com.google.dart.java2dart.util.ASTFactory.typeName;
import java.util.List;
@@ -51,6 +53,14 @@ public class GuavaSemanticProcessor extends SemanticProcessor {
replaceNode(node, instanceCreationExpression(Keyword.NEW, typeName("Map")));
return null;
}
+ if (isMethodInClass(node, "newArrayList", "com.google.common.collect.Lists")) {
+ replaceNode(node, listLiteral());
+ return null;
+ }
+ if (isMethodInClass(node, "newHashMap", "com.google.common.collect.Maps")) {
+ replaceNode(node, mapLiteral());
+ return null;
+ }
if (isMethodInClass(node, "newHashSet", "com.google.common.collect.Sets")) {
replaceNode(node, instanceCreationExpression(Keyword.NEW, typeName("Set")));
return null;

Powered by Google App Engine
This is Rietveld 408576698