Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.5
    • Fix Version/s: JRuby 1.6.6
    • Component/s: Standard Library
    • Labels:
      None
    • Environment:
      JRuby 1.6.5 on Linux and Windows with Java 7
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      1. Sample code that shows the problem (test.rb):
      2. Create an array
        array = %w(value1 value2 a_value value2)
      3. Print the whole array
        puts array.inspect
      4. Copy and modify an array
        new_array = Array.new(array)
        new_array.select! { |element| element.start_with?("value") }
        puts new_array.inspect
        puts array.inspect
        
      5. Output of the above code:
        jruby --1.9 test.rb
        ["value1", "value2", "a_value", "value2"]
        ["value1", "value2", "value2"]
        ["value1", "value2", "value2", "value2"]
        
        rvm use 1.9.3
        ruby test.rb
        ["value1", "value2", "a_value", "value2"]
        ["value1", "value2", "value2"]
        ["value1", "value2", "a_value", "value2"]
        

      A GitHub pull request to fix this issue:
      https://github.com/jruby/jruby/pull/114

        Activity

        Hide
        Eric Barendt added a comment -

        Sorry for the numbers. JIRA interpreted some of my # comments as the start of a list.

        Show
        Eric Barendt added a comment - Sorry for the numbers. JIRA interpreted some of my # comments as the start of a list.
        Hide
        Charles Oliver Nutter added a comment -

        On master@11cedba and jruby-1_6@093aa95. Thanks for the report and pull request!

        Show
        Charles Oliver Nutter added a comment - On master@11cedba and jruby-1_6@093aa95. Thanks for the report and pull request!

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Eric Barendt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: