Hash#rehash does not work under some condition
----------------------------------------------

                 Key: JRUBY-6209
                 URL: https://jira.codehaus.org/browse/JRUBY-6209
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.6
         Environment: any
            Reporter: Hiroshi Nakamura
            Assignee: Hiroshi Nakamura


This code raises an exception at the last line when hashCode of b is negative 
value.
{noformat}
a = "ASCII"
b = "\xE3\x81\x82" # Japanese 'a' in UTF-8

key = [a]
hash = Hash[key => 100]
hash[key] == 100 or raise

key[0] = b
p "---"
hash[key] == nil or raise

hash.rehash
hash[key] == 100 or raise
{noformat}

Fix follows.

--
This message is automatically generated by JIRA.
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