diff options
author | Sam Ruby <rubys@php.net> | 2000-05-12 09:51:16 +0000 |
---|---|---|
committer | Sam Ruby <rubys@php.net> | 2000-05-12 09:51:16 +0000 |
commit | 33ceae28094b0c800fe39fa9d66313b3d687b21e (patch) | |
tree | 7b2f992485f2b9bd1fc91e5413dd4931601c171f /ext/rpc/java/reflect.java | |
parent | afedd22f19f59055d2574875db29f098004a1d67 (diff) | |
download | php-git-33ceae28094b0c800fe39fa9d66313b3d687b21e.tar.gz |
i18n, part I
Diffstat (limited to 'ext/rpc/java/reflect.java')
-rw-r--r-- | ext/rpc/java/reflect.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/rpc/java/reflect.java b/ext/rpc/java/reflect.java index b7693e907c..f2bc02a2f6 100644 --- a/ext/rpc/java/reflect.java +++ b/ext/rpc/java/reflect.java @@ -38,7 +38,7 @@ class reflect { // // Native methods // - private static native void setResultFromString(long result, String value); + private static native void setResultFromString(long result, byte value[]); private static native void setResultFromLong(long result, long value); private static native void setResultFromDouble(long result, double value); private static native void setResultFromBoolean(long result, boolean value); @@ -56,7 +56,7 @@ class reflect { if (value instanceof java.lang.String) { - setResultFromString(result, (String)value); + setResultFromString(result, ((String)value).getBytes()); } else if (value instanceof java.lang.Number) { @@ -155,6 +155,9 @@ class reflect { if (!c.isInstance(args[i])) break; weight++; } + } else if (parms[i].isInstance("")) { + if (!(args[i] instanceof byte[])) + weight+=9999; } else if (parms[i].isPrimitive()) { Class c=parms[i]; if (args[i] instanceof Number) { @@ -199,7 +202,9 @@ class reflect { Object result[] = args; for (int i=0; i<args.length; i++) { if (parms[i].isInstance(args[i])) continue; - if (args[i] instanceof Number && parms[i].isPrimitive()) { + if (args[i] instanceof byte[] && parms[i].isInstance("")) { + result[i] = new String((byte[])args[i]); + } else if (args[i] instanceof Number && parms[i].isPrimitive()) { if (result==args) result=(Object[])result.clone(); Class c = parms[i]; Number n = (Number)args[i]; |