File#lineno= breaks JRuby if non-integer argument supplied
----------------------------------------------------------

                 Key: JRUBY-2077
                 URL: http://jira.codehaus.org/browse/JRUBY-2077
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC1
         Environment: Latest JRuby 1.1RC1
            Reporter: Vladimir Sizikov
             Fix For: JRuby 1.1RC2


Something simple like:

file.lineno = 1.5

crashes JRuby with the following exception.

This also breaks rubyspecs run with latest specs (since I've added this case 
there :) ).

Fix is coming.

{noformat}
java.lang.ClassCastException: org.jruby.RubyFloat cannot be cast to 
org.jruby.RubyFixnum
        at org.jruby.RubyIO.lineno_set(RubyIO.java:1094)
        at org.jruby.RubyIOInvoker$lineno_set_method_1_0.call(Unknown Source)
        at 
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOne.call(JavaMethod.java:120)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:65)
        at 
org.jruby.evaluator.ASTInterpreter.attrAssignNode(ASTInterpreter.java:599)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:293)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:636)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:154)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:119)
        at org.jruby.runtime.Block.yield(Block.java:109)
        at org.jruby.RubyIO.open(RubyIO.java:863)
        at org.jruby.RubyIOInvoker$open_method_1_2.call(Unknown Source)
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
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