Skip to content

Commit 9773db5

Browse files
committed
[refactor] drop arg as its only used from one place
1 parent 8f62b4a commit 9773db5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,20 +1349,19 @@ public ASN1Data(Ruby runtime, RubyClass type) {
13491349
@JRubyMethod(visibility = Visibility.PRIVATE)
13501350
public IRubyObject initialize(final ThreadContext context,
13511351
final IRubyObject value, final IRubyObject tag, final IRubyObject tag_class) {
1352-
checkTag(context.runtime, tag, tag_class, "UNIVERSAL");
1352+
checkTag(context.runtime, tag, tag_class);
13531353
this.callMethod(context, "tag=", tag);
13541354
this.callMethod(context, "value=", value);
13551355
this.callMethod(context, "tag_class=", tag_class);
13561356
return this;
13571357
}
13581358

1359-
private void checkTag(final Ruby runtime, final IRubyObject tag,
1360-
final IRubyObject tagClass, final String expected) {
1359+
private void checkTag(final Ruby runtime, final IRubyObject tag, final IRubyObject tagClass) {
13611360
if ( ! (tagClass instanceof RubySymbol) ) {
13621361
throw newASN1Error(runtime, "invalid tag class");
13631362
}
1364-
if ( tagClass.toString().equals(expected) && RubyNumeric.fix2int(tag) > MAX_TAG_VALUE ) {
1365-
throw newASN1Error(runtime, "tag number for :" + expected + " too large");
1363+
if ( "UNIVERSAL".equals(tagClass.toString()) && RubyNumeric.fix2int(tag) > MAX_TAG_VALUE ) {
1364+
throw newASN1Error(runtime, "tag number for :UNIVERSAL too large (" + tag + ")");
13661365
}
13671366
}
13681367

0 commit comments

Comments
 (0)