Mercurial > octave
changeset 33145:a92f3c0c92d9
maint: merge stable to default
author | Rik <rik@octave.org> |
---|---|
date | Mon, 04 Mar 2024 12:39:32 -0800 |
parents | 440ef081efd8 (current diff) d043168d4cf2 (diff) |
children | 6e67f10b4d33 |
files | |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/methods.m Mon Mar 04 15:28:38 2024 -0500 +++ b/scripts/miscellaneous/methods.m Mon Mar 04 12:39:32 2024 -0800 @@ -60,14 +60,19 @@ endif if (isobject (obj)) - ## Call internal C++ function for Octave objects + ## Call internal C++ function for Octave objects. mtds_list = __methods__ (obj); elseif (ischar (obj)) - ## Could be a classname for an Octave class or Java class. + ## CLASSNAME could be an Octave class or Java class. ## Try Octave class first. [mtds_list, valid] = __methods__ (obj); if (! valid) - mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); + ## Try Java class second. + try + mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); + catch + error ("methods: class '%s' not found", obj); + end_try_catch mtds_list = ostrsplit (mtds_str, ';'); mtds_list = mtds_list(:); # return a column vector for compatibility havesigs = true; @@ -158,4 +163,5 @@ ## Test input validation %!error <Invalid call> methods () %!error <invalid option> methods ("ftp", "option1") +%!error <class 'foobar' not found> methods ('foobar') %!error <invalid input argument> methods (1)