ClassCastException: org.jruby.RubyObject cannot be cast to org.jruby.RubyNumeric
--------------------------------------------------------------------------------

                 Key: JRUBY-1099
                 URL: http://jira.codehaus.org/browse/JRUBY-1099
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.0.0RC3, JRuby 1.0.0RC2
         Environment: Ubuntu 7.04
Java 1.6.0-b105
Chronic (date/time parser) 0.2.2
            Reporter: Michael Black
            Assignee: Thomas E Enebo


I'm getting a 'ClassCastException: org.jruby.RubyObject cannot be cast to 
org.jruby.RubyNumeric' exception when calling Chronic.parse with certain 
formats.

e.g.
Chronic.parse('16:00')
and
Chronic.parse('4pm')
both fail, but 
Chronic.parse('june 4th') 
and 
Chronic.parse('today')
work fine.

I get the following stack trace:
NativeException: java.lang.ClassCastException: org.jruby.RubyObject cannot be 
cast to org.jruby.RubyNumeric
        from RubyTime.java:309:in `org.jruby.RubyTime.op_plus'
        from null:-1:in `org.jruby.RubyTimeInvokerop_plus1.call'
        from FastInvocationCallback.java:49:in 
`org.jruby.runtime.callback.FastInvocationCallback.execute'
        from SimpleCallbackMethod.java:81:in 
`org.jruby.internal.runtime.methods.SimpleCallbackMethod.call'
        from RubyObject.java:564:in `org.jruby.RubyObject.callMethod'
        from RubyObject.java:547:in `org.jruby.RubyObject.callMethod'
        from EvaluationState.java:559:in 
`org.jruby.evaluator.EvaluationState.callNode'
        from EvaluationState.java:207:in 
`org.jruby.evaluator.EvaluationState.evalInternal'
        from EvaluationState.java:439:in 
`org.jruby.evaluator.EvaluationState.arrayNode'
        from EvaluationState.java:190:in 
`org.jruby.evaluator.EvaluationState.evalInternal'
        from EvaluationState.java:548:in 
`org.jruby.evaluator.EvaluationState.callNode'
        from EvaluationState.java:207:in 
`org.jruby.evaluator.EvaluationState.evalInternal'
        from EvaluationState.java:164:in 
`org.jruby.evaluator.EvaluationState.eval'
        from Block.java:220:in `org.jruby.runtime.Block.yield'
        from Block.java:186:in `org.jruby.runtime.Block.yield'
        from RubyKernel.java:780:in `org.jruby.RubyKernel.rbCatch'
... 199 levels...
        from Main.java:173:in `org.jruby.Main.runInterpreter'
        from Main.java:120:in `org.jruby.Main.run'
        from Main.java:95:in `org.jruby.Main.main'
        from 
/opt/jruby/lib/ruby/gems/1.8/gems/chronic-0.2.2/lib/chronic/chronic.rb:86:in 
`parse'
        from (irb):5:in `binding'
        from /opt/jruby/lib/ruby/1.8/irb.rb:150:in `eval_input'
        from /opt/jruby/lib/ruby/1.8/irb.rb:70:in `signal_status'
        from /opt/jruby/lib/ruby/1.8/irb.rb:189:in `eval_input'
        from /opt/jruby/lib/ruby/1.8/irb.rb:70:in `each_top_level_statement'
        from /opt/jruby/lib/ruby/1.8/irb.rb:190:in `loop'
        from /opt/jruby/lib/ruby/1.8/irb.rb:190:in `catch'
        from /opt/jruby/lib/ruby/1.8/irb.rb:190:in `eval_input'
        from /opt/jruby/lib/ruby/1.8/irb.rb:70:in `start'
        from :-1:in `catch'
        from /opt/jruby/lib/ruby/1.8/irb.rb:71:in `start'

-- 
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