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

opening the singleton class of an exception breaks equal and inspect

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      When I open the singleton for an exception instance and define a method, it changes the inspect and equal properties.

      I've attached a test case that demonstrates the problem. The test passes on MRI 1.9, but fails on JRuby.

      1. test.rb
        0.4 kB
        Aaron Patterson

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Pretty simple one.

        commit 34783fa45511fc81a5d598ba8af9fae89dd73a00
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Fri Jul 20 16:29:32 2012 -0500
        
            Fix for JRUBY-6786
            
            opening the singleton class of an exception breaks equal and inspect
            
            We need to skip singletons for == and inspect on exceptions.
        
        :100644 100644 3a79e2c... 96cccc2... M	src/org/jruby/RubyException.java
        
        Show
        Charles Oliver Nutter added a comment - Pretty simple one. commit 34783fa45511fc81a5d598ba8af9fae89dd73a00 Author: Charles Oliver Nutter <headius@headius.com> Date: Fri Jul 20 16:29:32 2012 -0500 Fix for JRUBY-6786 opening the singleton class of an exception breaks equal and inspect We need to skip singletons for == and inspect on exceptions. :100644 100644 3a79e2c... 96cccc2... M src/org/jruby/RubyException.java

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Aaron Patterson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: