Issue Type: Bug Bug
Assignee: Thomas E Enebo
Created: 03/Dec/12 4:02 PM
Description:

The new CHM (named ConcurrentHashMapV8) implementation that is going to be used in JDK8 expects to be able to compareTo provided keys implementing the Comparable interface.

The problematic CHMv8's code in question looks like this: https://github.com/thedarkone/thread_safe/blob/e9e51e24/ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java#L836-L838

This runs into trouble with JRuby's compareTo implementation that expects <=> to be returning Numeric values, which is not the case for "incomparable" objects (a plain Object for example), that return {{nil}}s when compared. This results in {{TypeError}}s being thrown.

The somewhat hairy solution is to coerce nil}}s coming from {{<=> into 0 in JRuby's compareTo.

Project: JRuby
Priority: Minor Minor
Reporter: thedarkone
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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

Reply via email to