Skip to content

Commit 096fdc8

Browse files
mkristiankares
authored andcommitted
Revert "make sure we have IO::WaitReadable and IO::WaitWritable with 1.8 mode"
and uses getConstantAt instead of getConstant This reverts commit df111b759538281e33a7d6b18bfe95f97c7f3029. Conflicts: ext/openssl/src/main/java/org/jruby/ext/openssl/SSL.java [skip ci]
1 parent 5ff819a commit 096fdc8

File tree

1 file changed

+2
-11
lines changed
  • src/main/java/org/jruby/ext/openssl

1 file changed

+2
-11
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,17 @@ public class SSL {
5959
public static final long OP_NETSCAPE_CA_DN_BUG = 0x20000000L;
6060
public static final long OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 0x40000000L;
6161

62-
private static IRubyObject getConstantFromIO(Ruby runtime, String name) {
63-
try {
64-
return runtime.getIO().getConstant(name);
65-
}
66-
catch(Exception e) {
67-
return null;
68-
}
69-
}
70-
7162
public static void createSSL(final Ruby runtime, final RubyModule ossl) {
7263
final RubyModule _SSL = ossl.defineModuleUnder("SSL");
7364
final RubyClass _OpenSSLError = ossl.getClass("OpenSSLError");
7465
RubyClass _SSLError = _SSL.defineClassUnder("SSLError", _OpenSSLError, _OpenSSLError.getAllocator());
7566

76-
final IRubyObject _WaitReadable = getConstantFromIO(runtime, "WaitReadable");
67+
final IRubyObject _WaitReadable = runtime.getIO().getConstantAt("WaitReadable");
7768
if ( _WaitReadable != null ) { // since 2.0 (do not exist in 1.8 / 1.9)
7869
_SSL.defineClassUnder("SSLErrorWaitReadable", _SSLError, _OpenSSLError.getAllocator()).
7970
include(new IRubyObject[]{ _WaitReadable });
8071
}
81-
final IRubyObject _WaitWritable = getConstantFromIO(runtime, "WaitWritable");
72+
final IRubyObject _WaitWritable = runtime.getIO().getConstantAt("WaitWritable");
8273
if ( _WaitWritable != null ) { // since 2.0 (do not exist in 1.8 / 1.9)
8374
_SSL.defineClassUnder("SSLErrorWaitWritable", _SSLError, _OpenSSLError.getAllocator()).
8475
include(new IRubyObject[]{ _WaitWritable });

0 commit comments

Comments
 (0)