Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kares
Copy link
Member

@kares kares commented Mar 31, 2025

The test case is mirrored after a real-world Map impl from Guava:

map = com.google.common.cache.CacheBuilder.new_builder.build.as_map 
# map is an instance of: Java::ComGoogleCommonCache::LocalCache
map.compute(:foo) { |_, value| 42 }

leading to a false-positive warning:

(RuntimeError) multiple Java methods found, dumping backtrace and choosing compute(java.lang.Object,java.util.function.BiFunction)

upon inspection of the CallableSelector there were 2 methods:

  • public default java.lang.Object java.util.concurrent.ConcurrentMap.compute(java.lang.Object,java.util.function.BiFunction)
  • public default java.lang.Object java.util.Map.compute(java.lang.Object,java.util.function.BiFunction)]

@kares kares added this to the JRuby 9.4.13.0 milestone Mar 31, 2025
@kares kares requested a review from headius April 3, 2025 06:25
@headius
Copy link
Member

headius commented Apr 4, 2025

Nice one!

@headius headius merged commit 68ca032 into jruby:jruby-9.4 Apr 4, 2025
96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants