Skip to content

Commit

Permalink
dealing with joda-time-2.5 ArithmeticException
Browse files Browse the repository at this point in the history
  • Loading branch information
mkristian committed Nov 14, 2014
1 parent b4f75d5 commit ef6182f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/main/java/org/jruby/RubyTime.java
Expand Up @@ -1058,7 +1058,13 @@ public static IRubyObject at(ThreadContext context, IRubyObject recv, IRubyObjec
nanosecs = nano % 1000000;
}
time.setNSec(nanosecs);
time.dt = time.dt.withMillis(seconds * 1000 + millisecs);
try {
time.dt = time.dt.withMillis(seconds * 1000 + millisecs);
}
// joda-time 2.5 cab throw this exception
catch( ArithmeticException e ) {
throw runtime.newRangeError(e.getMessage());
}
}

time.getMetaClass().getBaseCallSite(RubyClass.CS_IDX_INITIALIZE).call(context, recv, time);
Expand Down

0 comments on commit ef6182f

Please sign in to comment.