Examples of newArgumentError()


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) {
                throw runtime.newArgumentError("invalid address string");
            } else {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                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) {
                throw runtime.newArgumentError("invalid address string");
            } else {
                // Try IPv6
                try {
                    InetAddress ipv6_addr = InetAddress.getByName(host);
                    if (ipv6_addr instanceof Inet6Address) {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                    InetAddress ipv6_addr = InetAddress.getByName(host);
                    if (ipv6_addr instanceof Inet6Address) {
                        host = ipv6_addr.getHostAddress();
                    }
                } catch (UnknownHostException uhe) {
                    throw runtime.newArgumentError("invalid address string");
                }
            }
        } else {
            throw runtime.newArgumentError("invalid args");
        }
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

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

        InetAddress addr;
        try {
            addr = InetAddress.getByName(host);
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

    @JRubyMethod(rest = true, backtrace = true)
    public static IRubyObject impl(ThreadContext context, IRubyObject self, IRubyObject[] args, final Block implBlock) {
        Ruby runtime = context.getRuntime();

        if (!implBlock.isGiven()) throw runtime.newArgumentError("block required to call #impl on a Java interface");

        final RubyArray methodNames = (args.length > 0) ? runtime.newArray(args) : null;

        RubyClass implClass = RubyClass.newClass(runtime, runtime.getObject());
        implClass.include(new IRubyObject[] {self});
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                    return method.call(runtime.getCurrentContext(), self, self.getMetaClass(), name, newArgs).toJava(m.getReturnType());
                } else if (m.hasSuperImplementation()) {
                    RubyClass superClass = self.getMetaClass().getSuperClass();
                    return RuntimeHelpers.invokeAs(runtime.getCurrentContext(), superClass, self, name, newArgs, Block.NULL_BLOCK).toJava(m.getReturnType());
                } else {
                    throw runtime.newArgumentError(newArgs.length, v);
                }
            }
        };

        try {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                    result = method.call(runtime.getCurrentContext(), self, self.getMetaClass(), name, newArgs);
                } else if (m.hasSuperImplementation()) {
                    RubyClass superClass = self.getMetaClass().getSuperClass();
                    result = RuntimeHelpers.invokeAs(runtime.getCurrentContext(), superClass, self, name, newArgs, Block.NULL_BLOCK);
                } else {
                    throw runtime.newArgumentError(newArgs.length, v);
                }
                if (m.getReturnType() == void.class) {
                    return null;
                } else {
                    return result.toJava(m.getReturnType());
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                }
            }
        }

        if (javaClass == null) {
            throw runtime.newArgumentError("unable to create proxy class: no java_class defined for " + clazz);
        }
       
        int interfaceCount = interfaceList.size();
        Class<?>[] interfaces = new Class<?>[interfaceCount];
        for (int i = interfaceCount; --i >= 0; ) {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                parser = null;
                StringBuilder message = new StringBuilder("syntax error");
                if (se.getProblemMark() != null) {
                    message.append(se.getProblemMark().toString());
                }
                throw runtime.newArgumentError(message.toString());
            }
        }

        return this;
    }
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                    return method.call(runtime.getCurrentContext(), self, self.getMetaClass(), name, newArgs).toJava(m.getReturnType());
                } else if (m.hasSuperImplementation()) {
                    RubyClass superClass = self.getMetaClass().getSuperClass();
                    return RuntimeHelpers.invokeAs(runtime.getCurrentContext(), superClass, self, name, newArgs, Block.NULL_BLOCK).toJava(m.getReturnType());
                } else {
                    throw runtime.newArgumentError(newArgs.length, v);
                }
            }
        };

        try {
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.