Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache-constructed-proxies #3602

Merged
merged 1 commit into from Jan 19, 2016

Conversation

@smellsblue
Copy link
Contributor

@smellsblue smellsblue commented Jan 18, 2016

Replicate the logic from org.jruby.javasupport.Java which determines whether an object should be cached.

I added some specs to ensure the caching is properly honored. If I comment out the new conditional, you can see that one of the new specs will correctly fail:

$ jruby -S rspec spec/java_integration/object/singleton_spec.rb spec/java_integration/types/wrapping_spec.rb
......F........

Failures:

  1) A Java method returning/receiving uncoercible Java types with persistence off doesn't cache the proxy when directly constructed
     Failure/Error: expect(object_proxy_cache.get(object)).to be_nil

       expected: nil
            got: #<Java::JavaLang::Object:0x38c6f217>
     # ./spec/java_integration/types/wrapping_spec.rb:74:in `block in (root)'

Finished in 0.103 seconds (files took 0.916 seconds to load)
15 examples, 1 failure

Failed examples:

rspec ./spec/java_integration/types/wrapping_spec.rb:72 # A Java method returning/receiving uncoercible Java types with persistence off doesn't cache the proxy when directly constructed

I wasn't sure if this was the right place to put these new specs, but it seemed like the most appropriate to me. Please let me know if I should move them.

@kares
Copy link
Member

@kares kares commented Jan 19, 2016

👏 job Mike, thanks // cc @headius this should be the left-over from #3581

headius added a commit that referenced this issue Jan 19, 2016
@headius headius merged commit 8e8485a into jruby:master Jan 19, 2016
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@headius
Copy link
Member

@headius headius commented Jan 19, 2016

Looks good, thank you for your work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants