summaryrefslogtreecommitdiff
path: root/ext/java
diff options
context:
space:
mode:
Diffstat (limited to 'ext/java')
-rw-r--r--ext/java/java.c2
-rw-r--r--ext/java/reflect.java6
2 files changed, 5 insertions, 3 deletions
diff --git a/ext/java/java.c b/ext/java/java.c
index 5bc92eca30..10ee1391ce 100644
--- a/ext/java/java.c
+++ b/ext/java/java.c
@@ -578,7 +578,7 @@ JNIEXPORT jlong JNICALL Java_net_php_reflect_nextElement
}
JNIEXPORT void JNICALL Java_net_php_reflect_setException
- (JNIEnv *jenv, jclass self, jlong result, jstring value)
+ (JNIEnv *jenv, jclass self, jlong result, jbyteArray value)
{
pval *presult = (pval*)(long)result;
Java_net_php_reflect_setResultFromString(jenv, self, result, value);
diff --git a/ext/java/reflect.java b/ext/java/reflect.java
index 348d89b3c9..0d6347cf84 100644
--- a/ext/java/reflect.java
+++ b/ext/java/reflect.java
@@ -45,7 +45,7 @@ public class reflect {
private static native void setResultFromObject(long result, Object value);
private static native void setResultFromArray(long result);
private static native long nextElement(long array);
- private static native void setException(long result, String value);
+ private static native void setException(long result, byte value[]);
public static native void setEnv();
//
@@ -94,7 +94,7 @@ public class reflect {
if (t!=null) e=t;
}
- setException(result, e.toString());
+ setException(result, e.toString().getBytes());
}
//
@@ -295,6 +295,7 @@ public class reflect {
Method method;
if (args!=null && args.length>0) {
method=props[i].getWriteMethod();
+ args = coerce(method.getParameterTypes(), args);
} else {
method=props[i].getReadMethod();
}
@@ -307,6 +308,7 @@ public class reflect {
for (int i=0; i<jfields.length; i++) {
if (jfields[i].getName().equalsIgnoreCase(prop)) {
if (args!=null && args.length>0) {
+ args = coerce(new Class[] {jfields[i].getType()}, args);
jfields[i].set(object, args[0]);
} else {
setResult(result, jfields[i].get(object));