JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-5846

JRuby Internal Java NegativeArraySizeExcetpion when normalising a string

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.1
    • Fix Version/s: JRuby 1.6.7
    • Component/s: Application Error
    • Labels:
      None
    • Environment:
      Mac os x 10.6.7
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      A JRuby internal NegativeArraySizeExcetpion is thrown when trying to strip certain characters from a string. The following test reproduces the error:

      # -*- encoding : utf-8 -*-
      require 'active_support/core_ext'
      require 'test/unit'
      
      class String
        def strip_noise()
          return if empty?
          self.force_encoding('utf-8').mb_chars.normalize(:kd).gsub(/[^\x00-\x7F]/n,'').to_s().strip()
        end
      end
      
      class StringTests < Test::Unit::TestCase
        def test_strip_illegal_chars()
          assert_equal("", "        \xC2\xA0".strip_noise())
        end
      end
      

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Reproduced with jruby-1_6 branch. Investigating.

        Show
        Charles Oliver Nutter added a comment - Reproduced with jruby-1_6 branch. Investigating.
        Hide
        Charles Oliver Nutter added a comment -

        Still blowing up on jruby-1_6 branch and presumably master as well. Won't make 1.6.3.

        Show
        Charles Oliver Nutter added a comment - Still blowing up on jruby-1_6 branch and presumably master as well. Won't make 1.6.3.
        Hide
        Hiro Asari added a comment -

        Fixed on master, but not on 1.6.

        Show
        Hiro Asari added a comment - Fixed on master, but not on 1.6.
        Hide
        Thomas E Enebo added a comment -

        This also works on 1.6 marking as solved for 1.6.7.

        Show
        Thomas E Enebo added a comment - This also works on 1.6 marking as solved for 1.6.7.

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Paul Cowan
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: