comparison scripts/miscellaneous/methods.m @ 32055:dfd2b1a268a0

Don't list non-public or hidden functions from methods() (bug #64066) * ov-classdef.cc (Fproperties): Use property name from property_map variable , which is already known, rather than calling get_name() method which causes cascade of multiple methods to be invoked. * ov-classdef.cc (F__methods__): Change function signature to return a flag "found" if input was a classdef class or instance. Add code to check "Access" and "Hidden" properties before including in list of methods. Add BIST test for __methods__. * methods.m: Use second output from __methods__ to determine whether __methods__ call was successful.
author Rik <rik@octave.org>
date Tue, 25 Apr 2023 18:09:29 -0700
parents 597f3ee61a48
children d98157d51a97
comparison
equal deleted inserted replaced
32054:5998f6639148 32055:dfd2b1a268a0
63 ## Call internal C++ function for Octave objects 63 ## Call internal C++ function for Octave objects
64 mtds_list = __methods__ (obj); 64 mtds_list = __methods__ (obj);
65 elseif (ischar (obj)) 65 elseif (ischar (obj))
66 ## Could be a classname for an Octave class or Java class. 66 ## Could be a classname for an Octave class or Java class.
67 ## Try Octave class first. 67 ## Try Octave class first.
68 mtds_list = __methods__ (obj); 68 [mtds_list, valid] = __methods__ (obj);
69 if (isempty (mtds_list)) 69 if (! valid)
70 mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); 70 mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj);
71 mtds_list = ostrsplit (mtds_str, ';'); 71 mtds_list = ostrsplit (mtds_str, ';');
72 mtds_list = mtds_list(:); # return a column vector for compatibility 72 mtds_list = mtds_list(:); # return a column vector for compatibility
73 havesigs = true; 73 havesigs = true;
74 endif 74 endif