@JRubyMethod(name = "alloc", meta = true) public static RubyString alloc(ThreadContext context, IRubyObject recv, IRubyObject size) { return RubyString.newStringLight(context.runtime, RubyInteger.fix2int(size)); }
@JRubyMethod(name = "alloc", meta = true) public static RubyString alloc(ThreadContext context, IRubyObject recv, IRubyObject size) { return RubyString.newStringLight(context.runtime, RubyInteger.fix2int(size)); }
@Override @SuppressWarnings("unchecked") public int compare(final Object o1, final Object o2) { if ( o1 instanceof Comparable && o2 instanceof Comparable ) { // IRubyObjects are comparable and compareTo uses <=> return ((Comparable) o1).compareTo(o2); } final IRubyObject r1, r2; if ( o1 instanceof IRubyObject ) r1 = (IRubyObject) o1; else r1 = convertJavaToUsableRubyObject(context.runtime, o1); if ( o2 instanceof IRubyObject ) r2 = (IRubyObject) o2; else r2 = convertJavaToUsableRubyObject(context.runtime, o2); return RubyInteger.fix2int( compare(context, r1, r2) ); }
@Override @SuppressWarnings("unchecked") public int compare(final Object o1, final Object o2) { if ( o1 instanceof Comparable && o2 instanceof Comparable ) { // IRubyObjects are comparable and compareTo uses <=> return ((Comparable) o1).compareTo(o2); } final IRubyObject r1, r2; if ( o1 instanceof IRubyObject ) r1 = (IRubyObject) o1; else r1 = convertJavaToUsableRubyObject(context.runtime, o1); if ( o2 instanceof IRubyObject ) r2 = (IRubyObject) o2; else r2 = convertJavaToUsableRubyObject(context.runtime, o2); return RubyInteger.fix2int( compare(context, r1, r2) ); }
@Override public int compare(final Object o1, final Object o2) { final IRubyObject r1, r2; if ( o1 instanceof IRubyObject ) r1 = (IRubyObject) o1; else r1 = convertJavaToUsableRubyObject(context.runtime, o1); if ( o2 instanceof IRubyObject ) r2 = (IRubyObject) o2; else r2 = convertJavaToUsableRubyObject(context.runtime, o2); return RubyInteger.fix2int( compare(context, r1, r2) ); }
@Override public int compare(final Object o1, final Object o2) { final IRubyObject r1, r2; if ( o1 instanceof IRubyObject ) r1 = (IRubyObject) o1; else r1 = convertJavaToUsableRubyObject(context.runtime, o1); if ( o2 instanceof IRubyObject ) r2 = (IRubyObject) o2; else r2 = convertJavaToUsableRubyObject(context.runtime, o2); return RubyInteger.fix2int( compare(context, r1, r2) ); }
throw uncaught.uncaughtThrow(runtime, message, tag); } else { message += " in thread 0x" + Integer.toHexString(RubyInteger.fix2int(currentThread.id())); if (runtime.is1_9()) { throw runtime.newArgumentError(message);
throw uncaught.uncaughtThrow(runtime, message, tag); } else { message += " in thread 0x" + Integer.toHexString(RubyInteger.fix2int(currentThread.id())); if (runtime.is1_9()) { throw runtime.newArgumentError(message);