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
Change-Id: Iec02ba3084c992ea239ecef688d7d29c7e21ae16
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 @@
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 @@
/*
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 @@
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() {