summaryrefslogtreecommitdiffstats
path: root/test/021-string2/src/Main.java
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2014-01-15 13:49:50 -0800
committerJeff Hao <jeffhao@google.com>2015-04-27 18:54:52 -0700
commit848f70a3d73833fc1bf3032a9ff6812e429661d9 (patch)
treeb0349b3a40aab5a915af491b100659a5ca9fbbf6 /test/021-string2/src/Main.java
parentd14438f0c5071962be7fab572b54687d32d9d087 (diff)
downloadandroid_art-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.gz
android_art-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.bz2
android_art-848f70a3d73833fc1bf3032a9ff6812e429661d9.zip
Replace String CharArray with internal uint16_t array.
Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
Diffstat (limited to 'test/021-string2/src/Main.java')
-rw-r--r--test/021-string2/src/Main.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/021-string2/src/Main.java b/test/021-string2/src/Main.java
index 0239a3c626..0226614147 100644
--- a/test/021-string2/src/Main.java
+++ b/test/021-string2/src/Main.java
@@ -15,12 +15,13 @@
*/
import junit.framework.Assert;
+import java.lang.reflect.Method;
/**
* more string tests
*/
public class Main {
- public static void main(String args[]) {
+ public static void main(String args[]) throws Exception {
String test = "0123456789";
String test1 = new String("0123456789"); // different object
String test2 = new String("0123456780"); // different value
@@ -83,5 +84,10 @@ public class Main {
Assert.assertEquals("this is a path", test.replaceAll("/", " "));
Assert.assertEquals("this is a path", test.replace("/", " "));
+
+ Class Strings = Class.forName("com.android.org.bouncycastle.util.Strings");
+ Method fromUTF8ByteArray = Strings.getDeclaredMethod("fromUTF8ByteArray", byte[].class);
+ String result = (String) fromUTF8ByteArray.invoke(null, new byte[] {'O', 'K'});
+ System.out.println(result);
}
}