Examples of toJavaArray()


Examples of org.jruby.RubyArray.toJavaArray()

            // Masgn for 1.9 post-reqd args always come down this path
            if ((preArgsCount >= n) || (preArgsCount + postArgsCount >= n)) {
                return RubyArray.newEmptyArray(context.runtime);
            } else {
                // FIXME: Perf win to use COW between source Array and this new one (remove toJavaArray)
                return RubyArray.newArrayNoCopy(context.runtime, rubyArray.toJavaArray(), preArgsCount, (n - preArgsCount - postArgsCount));
            }
        }
    }

    @Override
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        if (argsNode == null) { // attribute set.
            RuntimeHelpers.invoke(context, receiver, getName(), new IRubyObject[] {value}, CallType.NORMAL, Block.NULL_BLOCK);
        } else { // element set
            RubyArray args = (RubyArray)argsNode.interpret(runtime, context, self, block);
            args.append(value);
            RuntimeHelpers.invoke(context, receiver, getName(), args.toJavaArray(), CallType.NORMAL, Block.NULL_BLOCK);
        }
       
        return runtime.getNil();
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        if (argsNode == null) { // attribute set.
            RuntimeHelpers.invoke(context, receiver, name, value);
        } else { // element set
            RubyArray args = (RubyArray) argsNode.interpret(runtime, context, self, block);
            args.append(value);
            RuntimeHelpers.invoke(context, receiver, name, args.toJavaArray());
        }
       
        return runtime.getNil();
    }
   
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        if (argsNode == null) { // attribute set.
            RuntimeHelpers.invoke(context, receiver, name, value, CallType.NORMAL, Block.NULL_BLOCK);
        } else { // element set
            RubyArray args = (RubyArray) argsNode.interpret(runtime, context, self, block);
            args.append(value);
            RuntimeHelpers.invoke(context, receiver, name, args.toJavaArray(), CallType.NORMAL, Block.NULL_BLOCK);
        }
       
        return runtime.getNil();
    }
   
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

           
            // FIXME: not very efficient
            RubyArray splattedArgs = RuntimeHelpers.splatValue(restArg);           
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(variableValues, 0, argValues, 0, totalArgs);
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            return argValues;
        }
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

           
            // FIXME: not very efficient
            RubyArray splattedArgs = RuntimeHelpers.splatValue(restArg);           
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(variableValues, 0, argValues, 0, totalArgs);
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            return argValues;
        }
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

                }
                value = new String(ByteList.plain(new DERSequence(asnv).getDEREncoded()));
            } else if(r_oid.equals(new DERObjectIdentifier("2.5.29.18"))) { //issuerAltName
                if(valuex.startsWith("issuer:copy")) {
                    RubyArray exts = (RubyArray)getInstanceVariable("@issuer_certificate").callMethod(tc,"extensions");
                    for (IRubyObject obj : exts.toJavaArray()) {
                        Extension exta = (Extension)obj;
                        if(exta.getRealOid().equals(new DERObjectIdentifier("2.5.29.17"))) {
                            value = exta.getRealValue();
                            break;
                        }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            IRubyObject val = callMethod(tc,"value");
            if(val instanceof RubyArray) {
                RubyArray arr = (RubyArray)callMethod(tc,"value");
                if(arr.size() > 1) {
                    ASN1EncodableVector vec = new ASN1EncodableVector();
                    for (IRubyObject obj : arr.toJavaArray()) {
                        vec.add(((ASN1Data)obj).toASN1());
                    }
                    return new DERTaggedObject(tag, new DERSequence(vec));
                } else {
                    return new DERTaggedObject(tag,((ASN1Data)(arr.getList().get(0))).toASN1());
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            printIndent(indent);
            System.out.println("ASN1Data: ");
            IRubyObject val = callMethod(getRuntime().getCurrentContext(),"value");
            if(val instanceof RubyArray) {
                RubyArray arr = (RubyArray)val;
                for (IRubyObject obj : arr.toJavaArray()) {
                    ((ASN1Data)obj).print(indent+1);
                }
            } else {
                ((ASN1Data)val).print(indent+1);
            }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            //            System.err.println(getMetaClass().getRealClass().getBaseName()+"#toASN1");
            int id = idForRubyName(getMetaClass().getRealClass().getBaseName());
            if(id != -1) {
                ASN1EncodableVector vec = new ASN1EncodableVector();
                RubyArray arr = (RubyArray)callMethod(getRuntime().getCurrentContext(),"value");
                for (IRubyObject obj : arr.toJavaArray()) {
                    if(obj instanceof ASN1Data) {
                        vec.add(((ASN1Data)obj).toASN1());
                    } else {
                        vec.add(((ASN1Data) ASN1.decode(getRuntime().getClassFromPath("OpenSSL::ASN1"), OpenSSLImpl.to_der_if_possible(obj))).toASN1());
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.