Enumerable is not mixed in HashMap ---------------------------------- Key: JRUBY-5383 URL: http://jira.codehaus.org/browse/JRUBY-5383 Project: JRuby Issue Type: Bug Components: Java Integration Affects Versions: JRuby 1.6RC1 Reporter: Antoine Toulme Fix For: JRuby 1.6RC2
In JRuby 1.6RC1, HashMap is not extended with the Enumerable mixin. To fix this, I used this code as hinted by headius: class Java::JavaUtil::HashMap; include Enumerable; end To reproduce the bug, try creating a simple bean: {code} public class MyBean { public Map<String, Object> newMap() { return new HashMap<String, Object>(); } } {code} Then use it in jruby: {code} bean = MyBean.new map = bean.newMap {code} Try a Enumerable method: {code} map.collect {|key, value| key == "Tintin"} {code} -- 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