@@ -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