CLONE -rcov.rb:654:in `aggregate_data': NilClass can't be coerced into Fixnum
(TypeError) when running jruby -S rake spec:rcov
------------------------------------------------------------------------------------------------------------------------------
Key: JRUBY-3842
URL: http://jira.codehaus.org/browse/JRUBY-3842
Project: JRuby
Issue Type: Bug
Components: Miscellaneous
Affects Versions: JRuby 1.1.3
Environment: jruby 1.1.3 rcov --no-ext v 0.8.1.2 2007-11-22
Reporter: Jeffrey Damick
Assignee: Charles Oliver Nutter
Fix For: JRuby 1.1.6
When i run the rspec:rcov task it bombs out with the following traceback:
usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:654:in `aggregate_data':
NilClass can't be coerced into Fixnum (TypeError)
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:654:in `each'
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:654:in
`each_with_index'
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:654:in
`aggregate_data'
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:652:in
`each_pair'
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:652:in
`aggregate_data'
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:490:in
`raw_data_relative'
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:431:in
`remove_hook'
from /usr/local/jruby-1.1.3/lib/ruby/site_ruby/1.8/rcov.rb:618:in
`remove_hook'
from /usr/local/jruby-1.1.3/bin/rcov:418
from :1
rake aborted!
This is because the arrays it iterates over on line 654 is full of nil values.
I dont know if that is a sign of a larger problem or not, and if it is because
of jruby - but the test runs work fine on the compiled mri rcov version.
A fix is to do a .to_i on the x value like this:
cov_arr.each_with_index{|x,i| dest[i] ||= 0; dest[i] += x.to_i}
It fixes the problem, and the test runs do run like that, and appear to be
accurate.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email