@Test(expected = IllegalStateException.class) public void testShouldThrowExceptionForAddressMissingPort() { System.setProperty("proteus.client.seedAddresses", "localhost:8001,localhost,localhost:8003"); List<SocketAddress> seedAddress = DefaultBuilderConfig.getSeedAddress(); }
static List<SocketAddress> getSeedAddress() { List<SocketAddress> seedAddresses = null; try { String s = conf.getString("proteus.client.seedAddresses"); if (s != null) { seedAddresses = new ArrayList<>(); String[] split = s.split(","); for (String a : split) { String[] split1 = a.split(":"); if (split1.length == 2) { String host = split1[0]; try { int port = Integer.parseInt(split1[1]); seedAddresses.add(InetSocketAddress.createUnresolved(host, port)); } catch (NumberFormatException fe) { throw new IllegalStateException("invalid seed address: " + a); } } else { throw new IllegalStateException("invalid seed address: " + a); } } } } catch (ConfigException.Missing m) { } return seedAddresses; }
DefaultBuilderConfig { static List<SocketAddress> getSeedAddress() { List<SocketAddress> seedAddresses = null; try { String s = conf.getString("proteus.client.seedAddresses"); if (s != null) { seedAddresses = new ArrayList<>(); String[] split = s.split(","); for (String a : split) { String[] split1 = a.split(":"); if (split1.length == 2) { String host = split1[0]; try { int port = Integer.parseInt(split1[1]); seedAddresses.add(InetSocketAddress.createUnresolved(host, port)); } catch (NumberFormatException fe) { throw new IllegalStateException("invalid seed address: " + a); } } else { throw new IllegalStateException("invalid seed address: " + a); } } } } catch (ConfigException.Missing m) { } return seedAddresses; } }
DefaultBuilderConfig { static List<SocketAddress> getSeedAddress() { List<SocketAddress> seedAddresses = null; try { String s = conf.getString("proteus.client.seedAddresses"); if (s != null) { seedAddresses = new ArrayList<>(); String[] split = s.split(","); for (String a : split) { String[] split1 = a.split(":"); if (split1.length == 2) { String host = split1[0]; try { int port = Integer.parseInt(split1[1]); seedAddresses.add(InetSocketAddress.createUnresolved(host, port)); } catch (NumberFormatException fe) { throw new IllegalStateException("invalid seed address: " + a); } } else { throw new IllegalStateException("invalid seed address: " + a); } } } } catch (ConfigException.Missing m) { } return seedAddresses; } private  DefaultBuilderConfig(); }
DefaultBuilderConfig { static List<SocketAddress> getSeedAddress() { List<SocketAddress> seedAddresses = null; try { String s = conf.getString("proteus.client.seedAddresses"); if (s != null) { seedAddresses = new ArrayList<>(); String[] split = s.split(","); for (String a : split) { String[] split1 = a.split(":"); if (split1.length == 2) { String host = split1[0]; try { int port = Integer.parseInt(split1[1]); seedAddresses.add(InetSocketAddress.createUnresolved(host, port)); } catch (NumberFormatException fe) { throw new IllegalStateException("invalid seed address: " + a); } } else { throw new IllegalStateException("invalid seed address: " + a); } } } } catch (ConfigException.Missing m) { } return seedAddresses; } private  DefaultBuilderConfig();  }
DefaultBuilderConfig { static List<SocketAddress> getSeedAddress() { List<SocketAddress> seedAddresses = null; try { String s = conf.getString("proteus.client.seedAddresses"); if (s != null) { seedAddresses = new ArrayList<>(); String[] split = s.split(","); for (String a : split) { String[] split1 = a.split(":"); if (split1.length == 2) { String host = split1[0]; try { int port = Integer.parseInt(split1[1]); seedAddresses.add(InetSocketAddress.createUnresolved(host, port)); } catch (NumberFormatException fe) { throw new IllegalStateException("invalid seed address: " + a); } } else { throw new IllegalStateException("invalid seed address: " + a); } } } } catch (ConfigException.Missing m) { } return seedAddresses; } private  DefaultBuilderConfig();   }