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

Unified Diff: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/GuavaSemanticProcessorTest.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_test/src/com/google/dart/java2dart/processor/GuavaSemanticProcessorTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/GuavaSemanticProcessorTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/GuavaSemanticProcessorTest.java
index 3fc3e37c254b4cd317a3a903399ab4aa75274583..bd1388eb1a237dad0fce010e5f115642e2a74b81 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/GuavaSemanticProcessorTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/GuavaSemanticProcessorTest.java
@@ -43,6 +43,57 @@ public class GuavaSemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_Lists_newArrayList() throws Exception {
+ setFileLines(
+ "com/google/common/collect/Lists.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package com.google.common.collect;",
+ "import java.util.ArrayList;",
+ "public class Lists {",
+ " public static <T> ArrayList<T> newArrayList() { return null; }",
+ "}"));
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "import java.util.List;",
+ "import com.google.common.collect.Lists;",
+ "public class Test {",
+ " List<String> m = Lists.newArrayList();",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " List<String> m = [];",
+ "}");
+ }
+
+ public void test_Maps_newHashMap() throws Exception {
+ setFileLines(
+ "com/google/common/collect/Maps.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package com.google.common.collect;",
+ "import java.util.HashMap;",
+ "public class Maps {",
+ " public static <T> HashMap<T> newHashMap() { return null; }",
+ "}"));
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "import java.util.List;",
+ "import java.util.Map;",
+ "import com.google.common.collect.Maps;",
+ "public class Test {",
+ " Map<String, List<String>> m = Maps.newHashMap();",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " Map<String, List<String>> m = {};",
+ "}");
+ }
+
public void test_Objects_equal() throws Exception {
setFileLines(
"com/google/common/base/Objects.java",

Powered by Google App Engine
This is Rietveld 408576698