@Test public void testMalformedAddress() { try { FederationResponse response = Federation.resolve("bob*stellar.org*test"); fail("Expected exception"); } catch (MalformedAddressException e) { } }
public static FederationResponse resolve(String value) { String[] tokens = value.split("\\*"); if (tokens.length == 1) { return new FederationResponse(null, value, null, null); } else if (tokens.length == 2) { String domain = tokens[1]; FederationServer server = FederationServer.createForDomain(domain); return server.resolveAddress(value); } else { throw new MalformedAddressException(); } }
Federation { public static FederationResponse resolve(String value) { String[] tokens = value.split("\\*"); if (tokens.length == 1) { return new FederationResponse(null, value, null, null); } else if (tokens.length == 2) { String domain = tokens[1]; FederationServer server = FederationServer.createForDomain(domain); return server.resolveAddress(value); } else { throw new MalformedAddressException(); } } }
Federation { public static FederationResponse resolve(String value) { String[] tokens = value.split("\\*"); if (tokens.length == 1) { return new FederationResponse(null, value, null, null); } else if (tokens.length == 2) { String domain = tokens[1]; FederationServer server = FederationServer.createForDomain(domain); return server.resolveAddress(value); } else { throw new MalformedAddressException(); } } private  Federation(); }
Federation { public static FederationResponse resolve(String value) { String[] tokens = value.split("\\*"); if (tokens.length == 1) { return new FederationResponse(null, value, null, null); } else if (tokens.length == 2) { String domain = tokens[1]; FederationServer server = FederationServer.createForDomain(domain); return server.resolveAddress(value); } else { throw new MalformedAddressException(); } } private  Federation(); static FederationResponse resolve(String value); }
Federation { public static FederationResponse resolve(String value) { String[] tokens = value.split("\\*"); if (tokens.length == 1) { return new FederationResponse(null, value, null, null); } else if (tokens.length == 2) { String domain = tokens[1]; FederationServer server = FederationServer.createForDomain(domain); return server.resolveAddress(value); } else { throw new MalformedAddressException(); } } private  Federation(); static FederationResponse resolve(String value);  }