Skip to content

Commit d967c36

Browse files
committed
[refactor] dry-out places using Date.new internals
1 parent f385fcc commit d967c36

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/java/arjdbc/util/DateTimeUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,7 @@ public static IRubyObject parseDate(final ThreadContext context, final CharSeque
348348

349349
if ( bcEra ) year = -1 * year; // no + 1 since we use GJChronology
350350

351-
DateTime dateTime = new DateTime(year, month, day, 0, 0, 0, GJChronology.getInstance(defaultZone));
352-
final Ruby runtime = context.runtime;
353-
return runtime.getClass("Date").newInstance(context, Java.getInstance(runtime, dateTime), Block.NULL_BLOCK);
351+
return newDate(context, year, month, day, GJChronology.getInstance(defaultZone));
354352
}
355353

356354
public static IRubyObject parseTime(final ThreadContext context, final CharSequence str, final DateTimeZone defaultZone)

0 commit comments

Comments
 (0)