Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Launcher
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Run the following ruby script. This testcase seems to be part of the one that is shipped with ruby 1.7.0 source .

      require 'test/unit'

      class TestMethodMissing < Test::Unit::TestCase

      class AMethodMissingClass
      def method_missing name, *args
      1
      end
      end

      def test_attr_assign_missing_returns_rhs
      assert_equal(AMethodMissingClass.new.foo=2, 2) <-----------------------------------------
      assert_equal(eval("AMethodMissingClass.new.foo=2"), 2)
      end

      end

      The reason for failure with 1.7.0 seems to be there because it is not getting the value "2" assigned in the pointed out assertion.
      Hence the comparison happens between value "1" and "2" and the failure occurs.

      One more observation here is that when I run the script with --debug option , i.e as "jruby --debug test.rb " failure isn't seen.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Good catch. I thought I handled this correctly, but perhaps I missed something. Checking.

        Show
        Charles Oliver Nutter added a comment - Good catch. I thought I handled this correctly, but perhaps I missed something. Checking.
        Hide
        Charles Oliver Nutter added a comment -

        I think you may have an old JRuby build. I fixed this in the past month or so, and cold not reproduce your issue locally. If you still see it with a current build of 1.7, feel free to reopen.

        Show
        Charles Oliver Nutter added a comment - I think you may have an old JRuby build. I fixed this in the past month or so, and cold not reproduce your issue locally. If you still see it with a current build of 1.7, feel free to reopen.
        Hide
        Vinutha Nayak added a comment -

        Thanks for the quick update . I am opening this for more information.

        Following is the "jruby -version" output for the build I am using .

        jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-08-26 de85016) (OpenJDK Client VM 1.6.0_0) [linux-i386-java]

        Can you please let me know the exact build number , or source level or the link where we can pick the passing build ?

        Show
        Vinutha Nayak added a comment - Thanks for the quick update . I am opening this for more information. Following is the "jruby -version" output for the build I am using . jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-08-26 de85016) (OpenJDK Client VM 1.6.0_0) [linux-i386-java] Can you please let me know the exact build number , or source level or the link where we can pick the passing build ?
        Hide
        Hiro Asari added a comment - - edited

        Vinutha,

        You are showing us Java 6 output, and the JRuby build is from August.

        The problem does not manifest on Mac OS X:

        $ java -version
        openjdk version "1.7.0-u2-b21"
        OpenJDK Runtime Environment (build 1.7.0-u2-b21-20111216)
        OpenJDK 64-Bit Server VM (build 23.0-b06, mixed mode)
        $ jruby test/test_method_missing.rb 
        Loaded suite test/test_method_missing
        Started
        .........
        Finished in 0.098 seconds.
        
        9 tests, 15 assertions, 0 failures, 0 errors
        
        Show
        Hiro Asari added a comment - - edited Vinutha, You are showing us Java 6 output, and the JRuby build is from August. The problem does not manifest on Mac OS X: $ java -version openjdk version "1.7.0-u2-b21" OpenJDK Runtime Environment (build 1.7.0-u2-b21-20111216) OpenJDK 64-Bit Server VM (build 23.0-b06, mixed mode) $ jruby test/test_method_missing.rb Loaded suite test/test_method_missing Started ......... Finished in 0.098 seconds. 9 tests, 15 assertions, 0 failures, 0 errors
        Hide
        Charles Oliver Nutter added a comment -

        Vinutha: Any build from source or a build from http://ci.jruby.org/snapshots/master will have the fix in place. Please reopen only if you can reproduce with a recent (within the last month) build.

        Show
        Charles Oliver Nutter added a comment - Vinutha: Any build from source or a build from http://ci.jruby.org/snapshots/master will have the fix in place. Please reopen only if you can reproduce with a recent (within the last month) build.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: