Source:
<code>Configuration(Builder builder) { this.uri = builder.uri; this.uris = builder.uris; this.connectionPoolSize = builder.connectionPoolSize != null ? builder.connectionPoolSize : 50; this.encryptionLevel = builder.encryptionLevel; this.trustStrategy = builder.trustStrategy; this.trustCertFile = builder.trustCertFile; this.connectionLivenessCheckTimeout = builder.connectionLivenessCheckTimeout; this.verifyConnection = builder.verifyConnection != null ? builder.verifyConnection : false; this.autoIndex = builder.autoIndex != null ? AutoIndexMode.fromString(builder.autoIndex) : AutoIndexMode.NONE; this.generatedIndexesOutputDir = builder.generatedIndexesOutputDir != null ? builder.generatedIndexesOutputDir : "."; this.generatedIndexesOutputFilename = builder.generatedIndexesOutputFilename != null ? builder.generatedIndexesOutputFilename : "generated_indexes.cql"; this.neo4jConfLocation = builder.neo4jConfLocation; this.customProperties = builder.customProperties; this.useNativeTypes = builder.useNativeTypes; this.basePackages = builder.basePackages; <START> if (this.uri != null || (this.uris != null && uris.length >= 1)) { <END> parseAndSetParametersFromURI(); } else { this.driverName = Drivers.EMBEDDED.driverClassName(); } if (builder.username != null && builder.password != null) { if (this.credentials != null) { LOGGER.warn("Overriding credentials supplied in URI with supplied username and password."); } credentials = new UsernamePasswordCredentials(builder.username, builder.password); } }</code><technical_language>replace this check wit a call getSingleURI, save returned value, check for null pass parseAndSetParametersFromURI instead of calling getSingleURI there</technical_language>

Target:
Configuration(Builder builder) { this.uri = builder.uri; this.uris = builder.uris; this.connectionPoolSize = builder.connectionPoolSize != null ? builder.connectionPoolSize : 50; this.encryptionLevel = builder.encryptionLevel; this.trustStrategy = builder.trustStrategy; this.trustCertFile = builder.trustCertFile; this.connectionLivenessCheckTimeout = builder.connectionLivenessCheckTimeout; this.verifyConnection = builder.verifyConnection != null ? builder.verifyConnection : false; this.autoIndex = builder.autoIndex != null ? AutoIndexMode.fromString(builder.autoIndex) : AutoIndexMode.NONE; this.generatedIndexesOutputDir = builder.generatedIndexesOutputDir != null ? builder.generatedIndexesOutputDir : "."; this.generatedIndexesOutputFilename = builder.generatedIndexesOutputFilename != null ? builder.generatedIndexesOutputFilename : "generated_indexes.cql"; this.neo4jConfLocation = builder.neo4jConfLocation; this.customProperties = builder.customProperties; this.useNativeTypes = builder.useNativeTypes; this.basePackages = builder.basePackages; URI parsedUri = getSingleURI(); if (parsedUri != null) { parseAndSetParametersFromURI(parsedUri); } else { this.driverName = Drivers.EMBEDDED.driverClassName(); } if (builder.username != null && builder.password != null) { if (this.credentials != null) { LOGGER.warn("Overriding credentials supplied in URI with supplied username and password."); } credentials = new UsernamePasswordCredentials(builder.username, builder.password); } }