diff options
author | Fredrik Roubert <roubert@google.com> | 2015-07-28 00:14:08 +0200 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-07-27 16:23:46 -0700 |
commit | af50e415a187190488d4694f307c23705203c53e (patch) | |
tree | b1dbb0cd27a0b73feabae818756d54ad0e2ba49b /test | |
parent | 458a7c7aba37bf41e40862046846fa77046ac23c (diff) | |
download | art-af50e415a187190488d4694f307c23705203c53e.zip art-af50e415a187190488d4694f307c23705203c53e.tar.gz art-af50e415a187190488d4694f307c23705203c53e.tar.bz2 |
Bugfix: Java char is 16 bits, can not be treated as boolean.
Using SetFieldBooleanVolatile() and SetFieldBoolean() happens to work
for char values that only use the lower 8 bits, but is a mistake that
was introduced by the "Add AccessibleObject and Field to mirror" commit:
https://android.googlesource.com/platform/art/+/daaf326
(cherry picked from commit 3152c82b0d33e5fb0a4aa964ea58451c72734444)
Bug:22772717
Change-Id: Iec02ba3084c992ea239ecef688d7d29c7e21ae16
Diffstat (limited to 'test')
-rw-r--r-- | test/046-reflect/expected.txt | 2 | ||||
-rw-r--r-- | test/046-reflect/src/Main.java | 2 | ||||
-rw-r--r-- | test/100-reflect2/expected.txt | 2 | ||||
-rw-r--r-- | test/100-reflect2/src/Main.java | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/test/046-reflect/expected.txt b/test/046-reflect/expected.txt index fa053fb..d657d44 100644 --- a/test/046-reflect/expected.txt +++ b/test/046-reflect/expected.txt @@ -24,7 +24,7 @@ Method name is myMethod SuperTarget constructor ()V Target constructor ()V Before, float is 3.1415925 -myMethod: hi there 3.1415925 Q ! +myMethod: hi there 3.1415925 ✔ ! Result of invoke: 7 Calling no-arg void-return method myNoargMethod ()V diff --git a/test/046-reflect/src/Main.java b/test/046-reflect/src/Main.java index 0d8e576..0c90109 100644 --- a/test/046-reflect/src/Main.java +++ b/test/046-reflect/src/Main.java @@ -147,7 +147,7 @@ public class Main { Object[] argList = new Object[] { new String[] { "hi there" }, new Float(3.1415926f), - new Character('Q') + new Character('\u2714') }; System.out.println("Before, float is " + ((Float)argList[1]).floatValue()); diff --git a/test/100-reflect2/expected.txt b/test/100-reflect2/expected.txt index 7db61a1..c932761 100644 --- a/test/100-reflect2/expected.txt +++ b/test/100-reflect2/expected.txt @@ -1,6 +1,6 @@ true 8 -x +✔ 3.141592653589793 3.14 32 diff --git a/test/100-reflect2/src/Main.java b/test/100-reflect2/src/Main.java index 72e14b1..bf3a574 100644 --- a/test/100-reflect2/src/Main.java +++ b/test/100-reflect2/src/Main.java @@ -20,7 +20,7 @@ import java.util.*; class Main { private static boolean z = true; private static byte b = 8; - private static char c = 'x'; + private static char c = '\u2714'; private static double d = Math.PI; private static float f = 3.14f; private static int i = 32; @@ -144,7 +144,7 @@ class Main { /* private static boolean z = true; private static byte b = 8; - private static char c = 'x'; + private static char c = '\u2714'; private static double d = Math.PI; private static float f = 3.14f; private static int i = 32; @@ -263,7 +263,7 @@ class Main { show(ctor.newInstance((Object[]) null)); ctor = String.class.getConstructor(char[].class, int.class, int.class); - show(ctor.newInstance(new char[] { 'x', 'y', 'z', '!' }, 1, 2)); + show(ctor.newInstance(new char[] { '\u2714', 'y', 'z', '!' }, 1, 2)); } private static void testPackagePrivateConstructor() { |