@JRubyMethod(name = "name") public IRubyObject getName() { Ruby runtime = getRuntime(); CharSequence rubyName = threadImpl.getRubyName(); if (rubyName == null) return runtime.getNil(); return RubyString.newString(runtime, rubyName); }
@JRubyMethod(name = "name") public IRubyObject getName() { Ruby runtime = getRuntime(); CharSequence rubyName = threadImpl.getRubyName(); if (rubyName == null) return runtime.getNil(); return RubyString.newString(runtime, rubyName); }
@JRubyMethod @Override public synchronized IRubyObject inspect() { // FIXME: There's some code duplication here with RubyObject#inspect RubyString result = getRuntime().newString("#<"); Ruby runtime = getRuntime(); ThreadContext context = runtime.getCurrentContext(); result.cat(getMetaClass().getRealClass().toRubyString(context)); result.cat(':'); result.catString(identityString()); String id = threadImpl.getRubyName(); // thread.name if (notEmpty(id)) { result.cat('@'); result.append(getRuntime().newSymbol(id).to_s()); } if (notEmpty(file) && line >= 0) { result.cat('@'); result.catString(file); result.cat(':'); result.catString("" + (line + 1)); } result.cat(' '); result.catString(status.toString().toLowerCase()); result.cat('>'); return result; }
@JRubyMethod @Override public synchronized IRubyObject inspect() { // FIXME: There's some code duplication here with RubyObject#inspect RubyString result = getRuntime().newString("#<"); Ruby runtime = getRuntime(); ThreadContext context = runtime.getCurrentContext(); result.cat(getMetaClass().getRealClass().toRubyString(context)); result.cat(':'); result.catString(identityString()); String id = threadImpl.getRubyName(); // thread.name if (notEmpty(id)) { result.cat('@'); result.append(getRuntime().newSymbol(id).to_s()); } if (notEmpty(file) && line >= 0) { result.cat('@'); result.catString(file); result.cat(':'); result.catString("" + (line + 1)); } result.cat(' '); result.catString(status.toString().toLowerCase()); result.cat('>'); return result; }