Package org.jruby

Examples of org.jruby.Ruby.newArgumentError()


                    host = list.get(1).toString();
                    port = list.get(0).toString();

                } else {
                    throw runtime.newArgumentError("invalid address string");

                }

            } else if ((host = m.group(IPV4_HOST_GROUP)) == null || host.length() == 0 ||
                    (port = m.group(IPV4_PORT_GROUP)) == null || port.length() == 0) {
View Full Code Here


                }

            } else if ((host = m.group(IPV4_HOST_GROUP)) == null || host.length() == 0 ||
                    (port = m.group(IPV4_PORT_GROUP)) == null || port.length() == 0) {

                throw runtime.newArgumentError("invalid address string");

            } else {

                // Try IPv6
                try {
View Full Code Here

                    if (ipv6_addr instanceof Inet6Address) {
                        host = ipv6_addr.getHostAddress();
                    }

                } catch (UnknownHostException uhe) {
                    throw runtime.newArgumentError("invalid address string");

                }
            }

        } else {
View Full Code Here

                }
            }

        } else {
            throw runtime.newArgumentError("invalid args");

        }

        InetAddress addr;
View Full Code Here

    @JRubyMethod(visibility = Visibility.PRIVATE)
    public IRubyObject initialize(ThreadContext context, Block block) {
        final Ruby runtime = context.runtime;
        if (!root && (block == null || !block.isGiven())) {
            throw runtime.newArgumentError("tried to create Proc object without a block");
        }
        this.block = block;
        this.parent = context.getThread();
       
        initFiber(context);
View Full Code Here

            // here, the ASCII-encoded decimal or hex string is used
            try {
                this.value = new BigInteger(str.toString(), base);
                break;
            } catch (NumberFormatException e) {
                throw runtime.newArgumentError("value " + str + " is not legal for radix " + base);
            }
        case 0: // FIXME: not currently supporting BN_mpi2bn
            throw runtime.newArgumentError("unsupported radix: " + base);
        default:
            throw runtime.newArgumentError("illegal radix: " + base);
View Full Code Here

                break;
            } catch (NumberFormatException e) {
                throw runtime.newArgumentError("value " + str + " is not legal for radix " + base);
            }
        case 0: // FIXME: not currently supporting BN_mpi2bn
            throw runtime.newArgumentError("unsupported radix: " + base);
        default:
            throw runtime.newArgumentError("illegal radix: " + base);
        }
        return this;
    }
View Full Code Here

                throw runtime.newArgumentError("value " + str + " is not legal for radix " + base);
            }
        case 0: // FIXME: not currently supporting BN_mpi2bn
            throw runtime.newArgumentError("unsupported radix: " + base);
        default:
            throw runtime.newArgumentError("illegal radix: " + base);
        }
        return this;
    }
   
    @JRubyMethod(name="copy")
View Full Code Here

            return runtime.newString(new ByteList(bytes, false));
        case 10:
        case 16:
            return runtime.newString(value.toString(base).toUpperCase());
        case 0: // FIXME: not currently supporting BN_mpi2bn
            throw runtime.newArgumentError("unsupported radix: " + base);
        default:
            throw runtime.newArgumentError("illegal radix: " + base);
        }
    }
View Full Code Here

        case 16:
            return runtime.newString(value.toString(base).toUpperCase());
        case 0: // FIXME: not currently supporting BN_mpi2bn
            throw runtime.newArgumentError("unsupported radix: " + base);
        default:
            throw runtime.newArgumentError("illegal radix: " + base);
        }
    }

    @JRubyMethod(name="to_i")
    public IRubyObject bn_to_i() {
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.