Skip to content

Commit 62df676

Browse files
committed
revert reflective inspect for now
... as there are a few 'uniformity' pieces to figure out
1 parent 962eaf2 commit 62df676

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

core/src/main/java/org/jruby/java/proxies/ConcreteJavaProxy.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,6 @@ else if ( type.isAssignableFrom(clazz) ) {
246246
throw getRuntime().newTypeError("failed to coerce " + clazz.getName() + " to " + type.getName());
247247
}
248248

249-
@JRubyMethod
250-
public RubyString reflective_inspect(ThreadContext context) {
251-
return RubyString.newString(context.runtime, reflectiveToString(context, null));
252-
}
253-
254-
@JRubyMethod
255-
public RubyString reflective_inspect(ThreadContext context, IRubyObject opts) {
256-
return RubyString.newString(context.runtime, reflectiveToString(context, opts == context.nil ? null : opts.convertToHash()));
257-
}
258-
259249
@JRubyMethod
260250
public IRubyObject inspect(ThreadContext context) {
261251
return inspect(context.runtime, null); // -> toStringImpl
@@ -265,9 +255,7 @@ public IRubyObject inspect(ThreadContext context) {
265255
CharSequence toStringImpl(final Ruby runtime, final IRubyObject opts) {
266256
final ThreadContext context = runtime.getCurrentContext();
267257
DynamicMethod toString = toStringIfNotFromObject(context);
268-
if (toString == null) {
269-
return reflectiveToString(context, (RubyHash) opts); // a replacement for java.lang.Object#toString
270-
}
258+
if (toString == null) return hashyInspect().toString();
271259
IRubyObject str = toString.call(context, this, getMetaClass(), "toString");
272260
return str == context.nil ? "null" : str.convertToString(); // we don't return a nil (unlike to_s)
273261
}
@@ -328,9 +316,9 @@ private static char appendFields(final ThreadContext context, final StringBuilde
328316

329317
for (final Field field : fields) {
330318
if (accept(field, excludedFields)) {
331-
buffer.append(' ');
332319
if (sep == '\0') sep = ',';
333320
else buffer.append(sep);
321+
buffer.append(' ');
334322

335323
try {
336324
buffer.append(field.getName()).append('=').append(toStringValue(context, field.get(obj)));

0 commit comments

Comments
 (0)