Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.4
-
Fix Version/s: JRuby 1.1.5
-
Component/s: Core Classes/Modules
-
Labels:None
-
Number of attachments :
Description
The following test in test_higher_javasupport depends on a detail of Sun's ArrayList implementation: that it will call ensureCapacity when adding:
class FooArrayList < ArrayList
$ensureCapacity = false
def foo
size
end
def ensureCapacity(howmuch)
$ensureCapacity = true
super
end
end
def test_extending_java_classes
l = FooArrayList.new
assert_equal(0, l.foo)
l.add(100)
assert_equal(1, l.foo)
assert_equal(true, $ensureCapacity)
end
I have disabled it in the script because it fails to pass on IBM's JDK. We need a better test for this behavior (protected method overriding perhaps?) that doesn't depend on Sun JDK specific details.
Resolved by creating a new test (spec) in spec/java_integration/types/extension_spec.rb that does not depend on Sun JDK internals. Committed in 7917.