Skip to content

Commit

Permalink
reformatting code
Browse files Browse the repository at this point in the history
  • Loading branch information
shubha-rajan committed Nov 1, 2022
1 parent 2528959 commit f4d0267
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ class CloudSqlInstance {
* @param executor executor used to schedule asynchronous tasks
* @param keyPair public/private key pair used to authenticate connections
*/
CloudSqlInstance (
CloudSqlInstance(
String connectionName,
SQLAdmin apiClient,
boolean enableIamAuth,
CredentialFactory tokenSourceFactory,
ListeningScheduledExecutorService executor,
ListenableFuture<KeyPair> keyPair) throws IOException{
ListenableFuture<KeyPair> keyPair) throws IOException {

Matcher matcher = CONNECTION_NAME.matcher(connectionName);
checkArgument(
Expand Down Expand Up @@ -280,10 +280,10 @@ SSLSocket createSslSocket() throws IOException {
* preferredTypes.
*
* @param preferredTypes Preferred instance IP types to use. Valid IP types include "Public" and
* "Private".
* "Private".
* @return returns a string representing the IP address for the instance
* @throws IllegalArgumentException If the instance has no IP addresses matching the provided
* preferences.
* preferences.
*/
String getPreferredIp(List<String> preferredTypes) {
Map<String, String> ipAddrs = getInstanceData().getIpAddrs();
Expand Down Expand Up @@ -579,7 +579,7 @@ static GoogleCredentials getDownscopedCredentials(OAuth2Credentials credentials)
}
return downscoped;
}

private Date getTokenExpirationTime() {
return credentials.get().getAccessToken().getExpirationTime();
}
Expand Down Expand Up @@ -607,7 +607,7 @@ private long secondsUntilRefresh() {
*
* @param ex exception thrown by the Admin API request
* @param fallbackDesc generic description used as a fallback if no additional information can be
* provided to the user
* provided to the user
*/
private RuntimeException addExceptionContext(IOException ex, String fallbackDesc) {
// Verify we are able to extract a reason from an exception, or fallback to a generic desc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public final class CoreSocketFactory {
* Property used to set the application name for the underlying SQLAdmin client.
*
* @deprecated Use {@link #setApplicationName(String)} to set the application name
* programmatically.
* programmatically.
*/

@Deprecated
Expand Down Expand Up @@ -152,7 +152,7 @@ public static synchronized CoreSocketFactory getInstance() {
return coreSocketFactory;
}

private CloudSqlInstance getCloudSqlInstance(String instanceName, boolean enableIamAuth) {
private CloudSqlInstance getCloudSqlInstance(String instanceName, boolean enableIamAuth) {
return instances.computeIfAbsent(
instanceName,
k -> {
Expand All @@ -165,12 +165,13 @@ private CloudSqlInstance getCloudSqlInstance(String instanceName, boolean enable
});
}

private CloudSqlInstance getCloudSqlInstance(String instanceName) {
private CloudSqlInstance getCloudSqlInstance(String instanceName) {
return instances.computeIfAbsent(
instanceName,
k -> {
try {
return new CloudSqlInstance(k, adminApi, false, credentialFactory, executor, localKeyPair);
return new CloudSqlInstance(k, adminApi, false, credentialFactory, executor,
localKeyPair);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -227,7 +228,7 @@ public static Socket connect(Properties props) throws IOException {
*
* <p>Depending on the given properties, it may return either a SSL Socket or a Unix Socket.
*
* @param props Properties used to configure the connection.
* @param props Properties used to configure the connection.
* @param unixPathSuffix suffix to add the the Unix socket path. Unused if null.
* @return the newly created Socket.
* @throws IOException if error occurs during socket creation.
Expand Down Expand Up @@ -293,7 +294,7 @@ private String getHostIp(String instanceName, List<String> ipTypes) throws IOExc
* Creates a secure socket representing a connection to a Cloud SQL instance.
*
* @param instanceName Name of the Cloud SQL instance.
* @param ipTypes Preferred type of IP to use ("PRIVATE", "PUBLIC")
* @param ipTypes Preferred type of IP to use ("PRIVATE", "PUBLIC")
* @return the newly created Socket.
* @throws IOException if error occurs during socket creation.
*/
Expand Down

0 comments on commit f4d0267

Please sign in to comment.