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/100-reflect2 | |
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/100-reflect2')
-rw-r--r-- | test/100-reflect2/expected.txt | 2 | ||||
-rw-r--r-- | test/100-reflect2/src/Main.java | 6 |
2 files changed, 4 insertions, 4 deletions
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() { |