String host, port;
if (arg0 instanceof RubyArray) {
List list = ((RubyArray)arg0).getList();
int len = list.size();
if (len < 3 || len > 4) {
throw runtime.newArgumentError("array size should be 3 or 4, "+len+" given");
}
// if array has 4 elements, third element is ignored
host = list.size() == 3 ? list.get(2).toString() : list.get(3).toString();
port = list.get(1).toString();
} else if (arg0 instanceof RubyString) {