Source:
<code>public static ClientBuilder bluemix(String vcapServices, String instanceName) { Gson gson = new GsonBuilder().create(); if (vcapServices == null) { <START> throw new IllegalStateException("VCAP_SERVICES is not present."); <END> } CloudFoundryServices services; try { services = gson.fromJson(vcapServices, CloudFoundryServices.class); } catch (JsonParseException e){ throw new IllegalStateException("VCAP_SERVICES is not valid JSON.", e); } if (services.cloudantNoSQLDB == null || services.cloudantNoSQLDB.size() == 0) { throw new IllegalStateException("No Cloudant services present."); } if (instanceName == null) { if (services.cloudantNoSQLDB.size() == 1) { CloudFoundryServices.CloudFoundryService service = services.cloudantNoSQLDB.get(0); if (service.credentials == null || service.credentials.url == null) { throw new IllegalStateException("Invalid VCAP_SERVICES services."); } return ClientBuilder.url(service.credentials.url); } else { throw new IllegalArgumentException("Multiple Cloudant services present. " + "A service name must be specified."); } } for (CloudFoundryServices.CloudFoundryService service : services.cloudantNoSQLDB) { if (instanceName.equals(service.name)) { if (service.credentials == null || service.credentials.url == null) { throw new IllegalStateException("Invalid VCAP_SERVICES services."); } return ClientBuilder.url(service.credentials.url); } } throw new IllegalArgumentException( String.format("Cloudant service matching name %s not found.", instanceName) ); }</code><technical_language>This IllegalArgumentException</technical_language>

Target:
public static ClientBuilder bluemix(String vcapServices, String instanceName) { Gson gson = new GsonBuilder().create(); if (vcapServices == null) { throw new IllegalArgumentException("The vcapServices JSON information was null."); } CloudFoundryServices services; try { services = gson.fromJson(vcapServices, CloudFoundryServices.class); } catch (JsonParseException e){ throw new IllegalArgumentException("The vcapServices was not valid JSON.", e); } if (services.cloudantNoSQLDB == null || services.cloudantNoSQLDB.size() == 0) { throw new IllegalArgumentException("No Cloudant services information present."); } if (instanceName == null) { if (services.cloudantNoSQLDB.size() == 1) { CloudFoundryServices.CloudFoundryService service = services.cloudantNoSQLDB.get(0); if (service.credentials == null || service.credentials.url == null) { throw new IllegalArgumentException( "The Cloudant service instance information was invalid."); } return ClientBuilder.url(service.credentials.url); } else { throw new IllegalArgumentException("Multiple Cloudant service instances present. " + "A service instance name must be specified."); } } for (CloudFoundryServices.CloudFoundryService service : services.cloudantNoSQLDB) { if (instanceName.equals(service.name)) { if (service.credentials == null || service.credentials.url == null) { throw new IllegalArgumentException( "The Cloudant service instance information was invalid."); } return ClientBuilder.url(service.credentials.url); } } throw new IllegalArgumentException( String.format("Cloudant service instance matching name %s was not found.", instanceName) ); }