cvs: php4 /ext/java java.c reflect.java
| From: | Sam Ruby | Date: | Fri, 30 Jun 2000 04:48:45 +0000 |
| Subject: | cvs: php4 /ext/java java.c reflect.java | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-561@lists.php.net to get a copy of this message | ||
rubys Thu Jun 29 21:48:45 2000 EDT
Modified files:
/php4/ext/java java.c reflect.java
Log:
Fix garbage in warning strings, and IllegalArgumentException on
assignments which require data type conversions.
Index: php4/ext/java/java.c
diff -u php4/ext/java/java.c:1.24 php4/ext/java/java.c:1.25
--- php4/ext/java/java.c:1.24 Sat Jun 24 08:31:08 2000
+++ php4/ext/java/java.c Thu Jun 29 21:48:45 2000
@@ -578,7 +578,7 @@
}
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);
Index: php4/ext/java/reflect.java
diff -u php4/ext/java/reflect.java:1.10 php4/ext/java/reflect.java:1.11
--- php4/ext/java/reflect.java:1.10 Tue Jun 13 18:41:11 2000
+++ php4/ext/java/reflect.java Thu Jun 29 21:48:45 2000
@@ -45,7 +45,7 @@
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 @@
if (t!=null) e=t;
}
- setException(result, e.toString());
+ setException(result, e.toString().getBytes());
}
//
@@ -295,6 +295,7 @@
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 @@
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));