From 17648827b606c95d2b86ad08a99c4a19a49bbe1e Mon Sep 17 00:00:00 2001 From: Jelena Furundzic Date: Thu, 19 Dec 2024 02:34:21 -0800 Subject: [PATCH] check style --- .../jdbc/cloud/storage/SnowflakeGCSClient.java | 6 ++---- .../net/snowflake/client/jdbc/ConnectionIT.java | 13 +++++++++---- .../snowflake/client/jdbc/FileUploaderLatestIT.java | 6 +++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java index ca85340a0..5735e1c2b 100644 --- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java +++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java @@ -202,10 +202,8 @@ public StorageObjectSummaryCollection listObjects(String remoteStorageLocation, Page blobs = this.gcsClient.list(remoteStorageLocation, BlobListOption.prefix(prefix)); // Normal flow will never hit here. This is only for testing purposes if (isInjectedExceptionEnabled() - && SnowflakeGCSClient.injectedException - instanceof StorageProviderException) { - throw (StorageProviderException) - SnowflakeGCSClient.injectedException; + && SnowflakeGCSClient.injectedException instanceof StorageProviderException) { + throw (StorageProviderException) SnowflakeGCSClient.injectedException; } return new StorageObjectSummaryCollection(blobs); } catch (Exception e) { diff --git a/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java b/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java index 3f6acbe00..59a8a85cf 100644 --- a/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java +++ b/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java @@ -1018,10 +1018,12 @@ public void testFailOverOrgAccount() throws SQLException { public void testDiagnosticCheckFailsWithNoAllowlistFileProvided() throws SQLException { Properties props = new Properties(); props.put("ENABLE_DIAGNOSTICS", true); - try(Connection con = getConnection(props)) { + try (Connection con = getConnection(props)) { fail(); } catch (SnowflakeSQLException e) { - assertTrue(e.getMessage().contains("Diagnostics was enabled but an allowlist file was not provided")); + assertTrue( + e.getMessage() + .contains("Diagnostics was enabled but an allowlist file was not provided")); } } @@ -1030,10 +1032,13 @@ public void testDiagnosticCheckWithFakeAllowlistFileProvided() throws SQLExcepti Properties props = new Properties(); props.put("ENABLE_DIAGNOSTICS", true); props.put("DIAGNOSTICS_ALLOWLIST_FILE", "/some/path/allowlist.json"); - try(Connection con = getConnection(props)) { + try (Connection con = getConnection(props)) { fail(); } catch (Exception e) { - assertTrue(e.getMessage().contains("A connection was not created because the driver is running in diagnostics mode.")); + assertTrue( + e.getMessage() + .contains( + "A connection was not created because the driver is running in diagnostics mode.")); } } diff --git a/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java b/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java index 7a2ac8611..4022a4743 100644 --- a/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java +++ b/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java @@ -878,16 +878,16 @@ public void testListObjectsException() throws Exception { Properties paramProperties = new Properties(); paramProperties.put("GCS_USE_DOWNSCOPED_CREDENTIAL", true); SnowflakeGCSClient.setInjectedException( - new StorageProviderException(new Exception("could not list objects"))); + new StorageProviderException(new Exception("could not list objects"))); try (Connection con = getConnection("gcpaccount", paramProperties); - Statement statement = con.createStatement()) { + Statement statement = con.createStatement()) { try { statement.execute("create or replace stage testStage"); SFSession sfSession = con.unwrap(SnowflakeConnectionV1.class).getSfSession(); String command = "PUT file://" + getFullPathFileInResource(TEST_DATA_FILE) + " @testStage"; SnowflakeFileTransferAgent sfAgent = - new SnowflakeFileTransferAgent(command, sfSession, new SFStatement(sfSession)); + new SnowflakeFileTransferAgent(command, sfSession, new SFStatement(sfSession)); sfAgent.execute(); } catch (SnowflakeSQLException err) {