Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.2, JRuby 1.6.4
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Ubuntu 10.04 (2.6.32-33)
java 1.6.0_26-b03
-
Number of attachments :
Description
Found this problem trying to run Machinist v2.0.0beta2 but it happens in irb as well.
Here is a snippet I ran in a console. In my environment it randomly fails on 48th-49th iteration. After self[*keys] = [] empty array get added to keys and having the key is changed super(key) returns nil.
class AA < Hash
def []=(*keys)
value = keys.pop
super(keys, value)
end
def [](*keys)
if !has_key?(keys)
p keys
self[*keys] = []
p keys
end
super(keys)
end
end
def go(h,count)
count.times do |i|
key=[i,i]
h[key]<<i
end
end
go(AA.new, 100)
Can you check this with the master? You can grab a snapshot from http://ci.jruby.org/snapshots/ It appears to be fixed there.