OSDN Git Service

Add test for String init called from unresolvable class.
authorJeff Hao <jeffhao@google.com>
Tue, 12 May 2015 01:39:28 +0000 (18:39 -0700)
committerJeff Hao <jeffhao@google.com>
Tue, 12 May 2015 18:15:47 +0000 (11:15 -0700)
Bug: 20971268
Change-Id: I0cb027f5e29667e9d522eb01a6b966cd69abb104

test/127-secondarydex/expected.txt
test/127-secondarydex/src/Main.java
test/127-secondarydex/src/Test.java

index 29a1411..1c8defb 100644 (file)
@@ -1,3 +1,4 @@
 testSlowPathDirectInvoke
 Test
 Got null pointer exception
+Test
index c921c5b..0ede8ed 100644 (file)
@@ -24,6 +24,7 @@ import java.lang.reflect.Method;
 public class Main {
     public static void main(String[] args) {
         testSlowPathDirectInvoke();
+        testString();
     }
 
     public static void testSlowPathDirectInvoke() {
@@ -40,4 +41,11 @@ public class Main {
             System.out.println("Got unexpected exception " + e);
         }
     }
+
+    // For string change, test that String.<init> is compiled properly in
+    // secondary dex. See http://b/20870917
+    public static void testString() {
+        Test t = new Test();
+        System.out.println(t.toString());
+    }
 }
index 82cb901..8547e79 100644 (file)
@@ -22,4 +22,8 @@ public class Test extends Super {
     private void print() {
         System.out.println("Test");
     }
+
+    public String toString() {
+        return new String("Test");
+    }
 }