Hey,

So I've been wiring up JOpenSSL to use annotations instead of the old deprecated versions. When I found something really, really strange.

This wiring:
    CallbackFactory asncb = runtime.callbackFactory(ASN1.class);
mASN1.getMetaClass().defineFastMethod("decode",asncb.getFastSingletonMethod("decode",IRubyObject.class));
for this method def:
    public static IRubyObject decode(IRubyObject recv, IRubyObject obj) {
works fine.

But if I remove the above, and instead do:
    @JRubyMethod(meta=true, required=1)
    public static IRubyObject decode(IRubyObject recv, IRubyObject obj) {

I get this runtime exception:
java.io.EOFException
at org.bouncycastle.asn1.DefiniteLengthInputStream.toByteArray(Unknown Source)
       at org.bouncycastle.asn1.ASN1InputStream.buildObject(Unknown Source)
       at org.bouncycastle.asn1.ASN1InputStream.readObject(Unknown Source)
       at org.jruby.ext.openssl.ASN1.decode(ASN1.java:572)
at org.jruby.ext.openssl.ASN1Invoker$decode_s_method_1_0.call(Unknown Source)

I have no idea how that ends up happening. It seems extremely strange, since the both ways of wiring should be doing more or less the same thing.

Any explanations?

--
Ola Bini (http://ola-bini.blogspot.com) JRuby Core Developer
Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
Practical JRuby on Rails (http://apress.com/book/view/9781590598818)

"Yields falsehood when quined" yields falsehood when quined.



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to