Skip to content

Instantly share code, notes, and snippets.

@headius

headius/.diff Secret

Created November 12, 2019 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/afe5925e1f287609b24deb0aa4b619e5 to your computer and use it in GitHub Desktop.
Save headius/afe5925e1f287609b24deb0aa4b619e5 to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/javasupport/binding/MethodGatherer.java b/core/src/main/java/org/jruby/javasupport/binding/MethodGatherer.java
index 4cee230adc..e2bbe910d1 100644
--- a/core/src/main/java/org/jruby/javasupport/binding/MethodGatherer.java
+++ b/core/src/main/java/org/jruby/javasupport/binding/MethodGatherer.java
@@ -151,9 +151,8 @@ public class MethodGatherer {
// we scan all superclasses, but avoid adding superclass methods with
// same name+signature as subclass methods (see JRUBY-3130)
for ( Class<?> klass = javaClass; klass != null; klass = klass.getSuperclass() ) {
- // only add class's methods if it's public or we can set accessible
- // (see JRUBY-4799)
- if (Modifier.isPublic(klass.getModifiers()) || JavaUtil.CAN_SET_ACCESSIBLE) {
+ // only add class's methods if it's public (JIRA issue JRUBY-4799)
+ if (Modifier.isPublic(klass.getModifiers())) {
// for each class, scan declared methods for new signatures
try {
// add methods, including static if this is the actual class,
1) A Java object marshals local Java class
Failure/Error: caps_method = hash[:local].capsMethod
NoMethodError:
undefined method `capsMethod' for #<Java::Java_integrationFixtures::InnerClasses::1CapsImpl:0x590336ed>
Did you mean? method
# ./spec/java_integration/object/marshal_spec.rb:29:in `block in <main>'
# org/jruby/RubyBasicObject.java:2681:in `instance_exec'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:257:in `block in run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:503:in `block in with_around_and_singleton_context_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:460:in `block in with_around_example_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/hooks.rb:472:in `block in run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/hooks.rb:610:in `run_around_example_hooks_for'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/hooks.rb:472:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:460:in `with_around_example_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:503:in `with_around_and_singleton_context_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:254:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:633:in `block in run_examples'
# org/jruby/RubyArray.java:2577:in `map'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:629:in `run_examples'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:595:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block in run_specs'
# org/jruby/RubyArray.java:2577:in `map'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block in run_specs'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/configuration.rb:2031:in `with_suite_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:116:in `block in run_specs'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:74:in `report'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:115:in `run_specs'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:89:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:71:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:45:in `invoke'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/exe/rspec:4:in `<main>'
2) A Java object marshals anonymous Java class
Failure/Error: caps_method = array[0].capsMethod
NoMethodError:
undefined method `capsMethod' for #<Java::Java_integrationFixtures::InnerClasses::1:0x24fc9aa5>
Did you mean? method
# ./spec/java_integration/object/marshal_spec.rb:41:in `block in <main>'
# org/jruby/RubyBasicObject.java:2681:in `instance_exec'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:257:in `block in run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:503:in `block in with_around_and_singleton_context_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:460:in `block in with_around_example_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/hooks.rb:472:in `block in run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/hooks.rb:610:in `run_around_example_hooks_for'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/hooks.rb:472:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:460:in `with_around_example_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:503:in `with_around_and_singleton_context_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example.rb:254:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:633:in `block in run_examples'
# org/jruby/RubyArray.java:2577:in `map'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:629:in `run_examples'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:595:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block in run_specs'
# org/jruby/RubyArray.java:2577:in `map'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block in run_specs'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/configuration.rb:2031:in `with_suite_hooks'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:116:in `block in run_specs'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:74:in `report'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:115:in `run_specs'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:89:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:71:in `run'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:45:in `invoke'
# ./lib/ruby/gems/shared/gems/rspec-core-3.9.0/exe/rspec:4:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment