Skip to content

Commit 37c2cab

Browse files
committed
[test] for not exposing internal proxies (#8349)
1 parent 5a70a61 commit 37c2cab

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/jruby/test_higher_javasupport.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,29 @@ def test_indexed_bean_style_accessors_are_not_aliased
17371737
end
17381738
end
17391739

1740+
def test_no_warnings_on_interface_impls_being_set_as_constants
1741+
runner_base = Class.new do
1742+
class << self
1743+
def run; self != self end
1744+
end
1745+
end
1746+
1747+
runner_impl1 = Class.new(runner_base)
1748+
runner_impl2 = Class.new(runner_base)
1749+
runner_impl3 = Class.new(runner_base)
1750+
1751+
output = with_stderr_captured do
1752+
threads = []
1753+
threads << java.lang.Thread.new(runner_impl1)
1754+
threads << java.lang.Thread.new(runner_impl2)
1755+
threads << java.lang.Thread.new(runner_impl3)
1756+
threads.each(&:start)
1757+
threads.each(&:join)
1758+
end
1759+
# expect no warning: already initialized constant org.jruby.gen::InterfaceImpl1353309827
1760+
refute output.index('already initialized constant'), output
1761+
end
1762+
17401763
def test_no_warnings_on_concurrent_package_const_initialization
17411764
output = with_stderr_captured do
17421765
threads = (0..10).map do # smt not yet initialized :

0 commit comments

Comments
 (0)