Skip to content

Commit ad6bc89

Browse files
committed
[refactor] cleanup native impls that are now in .rb
1 parent 0d06604 commit ad6bc89

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.bouncycastle.asn1.ASN1Encoding;
4040
import org.bouncycastle.asn1.ASN1Integer;
4141
import org.bouncycastle.asn1.ASN1IA5String;
42-
import org.bouncycastle.asn1.ASN1Object;
4342
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
4443
import org.bouncycastle.asn1.ASN1OctetString;
4544
import org.bouncycastle.asn1.ASN1Primitive;
@@ -62,7 +61,6 @@
6261
import org.jruby.Ruby;
6362
import org.jruby.RubyArray;
6463
import org.jruby.RubyClass;
65-
import org.jruby.RubyHash;
6664
import org.jruby.RubyModule;
6765
import org.jruby.RubyNumeric;
6866
import org.jruby.RubyObject;
@@ -78,7 +76,6 @@
7876
import static org.jruby.ext.openssl.ASN1._ASN1;
7977
import static org.jruby.ext.openssl.X509._X509;
8078
import static org.jruby.ext.openssl.OpenSSL.*;
81-
import static org.jruby.ext.openssl.StringHelper.*;
8279

8380
/**
8481
* OpenSSL::X509::Extension
@@ -846,44 +843,6 @@ public IRubyObject eql_p(IRubyObject obj) {
846843
return equalImpl(getRuntime(), obj);
847844
}
848845

849-
// [ self.oid, self.value, self.critical? ]
850-
@JRubyMethod
851-
public RubyArray to_a(final ThreadContext context) {
852-
RubyArray array = RubyArray.newArray(context.runtime, 3);
853-
array.append(oid(context));
854-
array.append(value(context));
855-
array.append(critical_p(context));
856-
return array;
857-
}
858-
859-
// {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?
860-
@JRubyMethod
861-
public RubyHash to_h(final ThreadContext context) {
862-
final Ruby runtime = context.runtime;
863-
RubyHash hash = RubyHash.newHash(runtime);
864-
hash.op_aset(context, newStringFrozen(runtime, "oid"), oid(context));
865-
hash.op_aset(context, newStringFrozen(runtime, "value"), value(context));
866-
hash.op_aset(context, newStringFrozen(runtime, "critical"), critical_p(context));
867-
return hash;
868-
}
869-
870-
// "oid = critical, value"
871-
@JRubyMethod
872-
public RubyString to_s(final ThreadContext context) {
873-
final Ruby runtime = context.runtime;
874-
final RubyString str = RubyString.newString(runtime, oidSym(runtime));
875-
str.getByteList().append(' ').append('=').append(' ');
876-
if ( isRealCritical() ) str.getByteList().append(critical__);
877-
// self.value.gsub(/\n/, ", ")
878-
final RubyString value = value(context);
879-
value.callMethod(context, "gsub!", new IRubyObject[] {
880-
RubyString.newStringShared(runtime, StringHelper.NEW_LINE),
881-
RubyString.newStringShared(runtime, StringHelper.COMMA_SPACE)
882-
});
883-
str.getByteList().append(value.getByteList());
884-
return str;
885-
}
886-
887846
@Override
888847
public X509Extension clone() {
889848
try {

0 commit comments

Comments
 (0)