Skip to content

Commit 1fb3335

Browse files
committed
[fix] OpenSSL::X509::Name#inspect compat
1 parent db501d7 commit 1fb3335

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/java/org/jruby/ext/openssl/X509Name.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,15 @@ public IRubyObject initialize(final ThreadContext context, IRubyObject dn, IRuby
299299

300300
RubyArray arr = (RubyArray)obj;
301301

302-
IRubyObject entry0, entry1, entry2;
303-
entry0 = arr.size() > 0 ? arr.eltOk(0) : context.nil;
304-
entry1 = arr.size() > 1 ? arr.eltOk(1) : context.nil;
305-
entry2 = arr.size() > 2 ? arr.eltOk(2) : context.nil;
302+
IRubyObject name, value, type;
303+
name = arr.size() > 0 ? arr.eltOk(0) : context.nil;
304+
value = arr.size() > 1 ? arr.eltOk(1) : context.nil;
305+
type = arr.size() > 2 ? arr.eltOk(2) : context.nil;
306306

307-
if (entry2.isNil()) entry2 = template.callMethod(context, "[]", entry0);
308-
if (entry2.isNil()) entry2 = _Name.getConstant("DEFAULT_OBJECT_TYPE");
307+
if (type.isNil()) type = template.callMethod(context, "[]", name);
308+
if (type.isNil()) type = _Name.getConstant("DEFAULT_OBJECT_TYPE");
309309

310-
add_entry(context, entry0, entry1, entry2);
310+
add_entry(context, name, value, type);
311311
}
312312
}
313313
else {
@@ -494,7 +494,7 @@ public IRubyObject to_utf8(ThreadContext context) {
494494
@SuppressWarnings("unchecked")
495495
@JRubyMethod
496496
public IRubyObject inspect() {
497-
return ObjectSupport.inspect(this, Collections.EMPTY_LIST);
497+
return ObjectSupport.inspect(this, toFormat(getRuntime(), RFC2253));
498498
}
499499

500500
@Override

0 commit comments

Comments
 (0)