Mercurial > hg > octave-lyh
comparison scripts/general/methods.m @ 15816:59b6c6aee042
Don't box return values from javaObject. Always return a Java object.
* libinterp/octave-value/ov-java.cc(do_javaObject): Don't call box()
on newly created Java object.
* scripts/general/fieldnames.m: Work-around bug with java.lang.String
objects by calling getFields with class name rather than object.
* scripts/general/methods.m: Work-around bug with java.lang.String
objects by calling getMethods with class name rather than object.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 18 Dec 2012 11:54:57 -0800 |
parents | cf3a18843a26 |
children | 1de4ec2a856d |
comparison
equal
deleted
inserted
replaced
15815:f28b3dcbaa9a | 15816:59b6c6aee042 |
---|---|
44 if (isempty (mtds_list)) | 44 if (isempty (mtds_list)) |
45 mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); | 45 mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); |
46 mtds_list = strsplit (mtds_str, ';'); | 46 mtds_list = strsplit (mtds_str, ';'); |
47 endif | 47 endif |
48 elseif (isjava (obj)) | 48 elseif (isjava (obj)) |
49 ## FIXME: Function prototype that excepts java obj exists, but doesn't | |
50 ## work if obj is java.lang.String. Convert obj to classname. | |
51 obj = class (obj); | |
49 mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); | 52 mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); |
50 mtds_list = strsplit (mtds_str, ';'); | 53 mtds_list = strsplit (mtds_str, ';'); |
51 else | 54 else |
52 error ("methods: Invalid input argument"); | 55 error ("methods: Invalid input argument"); |
53 endif | 56 endif |