|
|
|
A better reproduction of the same
Clean up public/private/protected instance/class methods for 1.1, using Marcin's diff script and this bug plus
There is also an issue with singleton_methods that shouldn't use isPublic to filter the resulting array.
The script needs to be modified to catch singleton method differences too. Punting issues from 1.1 RC2 to 1.1 final.
Here's output from trunk today:
~/NetBeansProjects/jruby ➔ ruby test_public_methods.rb [Object, Kernel] ["==", "===", "=~", "__id__", "__send__", "class", "clone", "display", "dup", "eql?", "equal?", "extend", "freeze", "frozen?", "hash", "id", "include", "inspect", "instance_eval", "instance_of?", "instance_variable_defined?", "instance_variable_get", "instance_variable_set", "instance_variables", "is_a?", "kind_of?", "method", "methods", "nil?", "object_id", "private", "private_methods", "protected_methods", "public", "public_methods", "respond_to?", "send", "singleton_methods", "taint", "tainted?", "to_a", "to_s", "type", "untaint"] ~/NetBeansProjects/jruby ➔ jruby test_public_methods.rb [Object, Kernel] ["==", "===", "=~", "__id__", "__send__", "class", "clone", "display", "dup", "eql?", "equal?", "extend", "freeze", "frozen?", "hash", "id", "inspect", "instance_eval", "instance_exec", "instance_of?", "instance_variable_defined?", "instance_variable_get", "instance_variable_set", "instance_variables", "is_a?", "kind_of?", "method", "methods", "nil?", "object_id", "private_methods", "protected_methods", "public_methods", "respond_to?", "send", "singleton_methods", "taint", "tainted?", "to_a", "to_s", "type", "untaint"] The differences are:
So it's much closer now. The remaining methods may be the ones added to the toplevel singleton, so we're just not filtering them out correctly? Oops, mine wasn't running rake, so I suppose there's a number of other methods that get pulled in there. But probably the same issue?
Daniel has a smaller testcase involving a core class:
p Dir.public_instance_methods(false) C:\Documents and Settings\djberge\workspace\facade>ruby test.rb ["tell", "each", "path", "pos", "close", "read", "rewind", "pos=", "seek"] C:\Documents and Settings\djberge\workspace\facade>jruby test.rb ["initialize", "rewind", "each", "tell", "close", "pos", "pos=", "seek", "path", "entries", "read"] Also:
MRI > Math.public_methods(false) => ["acosh", "class_eval", "const_missing", "private_instance_methods", "tan", ">=", "<=", "log10", "to_s", "private_class_method", "sinh", "<", "include?", "public_instance_methods", "cos", "erf", "private_method_defined?", ">", "name", "exp", "const_get", "atan", "method_defined?", "ldexp", "included_modules", "class_variables", "asinh", "autoload?", "acos", "const_defined?", "sqrt", "module_eval", "tanh", "protected_method_defined?", "erfc", "protected_instance_methods", "sin", "log", "autoload", "ancestors", "instance_method", "const_set", "cosh", "public_class_method", "instance_methods", "atan2", "hypot", "public_method_defined?", "class_variable_defined?", "atanh", "<=>", "freeze", "constants", "asin", "==", "===", "frexp"] JRuby > Math.public_methods(false) => [] Actual Math methods also don't show up in Math.methods or Math.public_methods. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Object, RakeFileUtils, FileUtils, FileUtils::StreamUtils_, Kernel]
["public", "include", "private", "to_s", "java_kind_of?", "to_yaml_node", "file", "multitask", "taguri", "desc", "namespace", "timeout", "Rational", "to_yaml_properties", "include_class", "task", "directory", "file_create", "import", "rule", "to_yaml", "to_yaml_style", "sh", "chmod", "ln_s", "mv", "symlink", "install", "nowrite", "safe_unlink", "rm_f", "copy", "ln", "mkpath", "cp_r", "mkdir", "mkdir_p", "chdir", "move", "rmdir", "chown_R", "ln_sf", "cp", "chown", "ruby", "link", "remove", "rm", "rmtree", "chmod_R", "rm_r", "cd", "makedirs", "verbose", "touch", "when_writing", "rm_rf", "split_all", "fu_world_writable?", "safe_ln", "object_id", "frozen?", "eql?", "=~", "methods", "to_a", "tainted?", "javax", "trap", "taint", "public_methods", "dup", "method", "==", "singleton_methods", "is_a?", "instance_eval", "equal?", "instance_variable_get", "com", "instance_of?", "hash", "inspect", "java", "org", "__id__", "clone", "__send__", "id", "instance_variable_set", "send", "gem", "untaint", "class", "protected_methods", "kind_of?", "require_gem", "instance_variables", "display", "extend", "freeze", "private_methods", "nil?", "type", "===", "instance_exec", "require", "respond_to?"]