Skip to content

Commit 0991fe4

Browse files
authored
---
yaml --- r: 13257 b: refs/heads/autosynth-texttospeech c: 2a63c96 h: refs/heads/master i: 13255: 304ad9b
1 parent fd7876f commit 0991fe4

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ refs/heads/autosynth-securitycenter: 8e95447ccb176c3648880ee0cb926cd1f4065156
143143
refs/heads/autosynth-spanner: 563dc6c78c6a2579b681f441f0a9b59005212394
144144
refs/heads/autosynth-speech: 878243784f42771467d7cf52bd59e4a6a7950ee9
145145
refs/heads/autosynth-tasks: afc9f4da54964dea5e7f3a9b164db282fc35db5c
146-
refs/heads/autosynth-texttospeech: ad05c812118b51dbc69a16b4aa7ecaf239a23577
146+
refs/heads/autosynth-texttospeech: 2a63c9692500cf1586f9ba1bb26b6faf08353dc1
147147
refs/heads/autosynth-trace: 80c58aa2fb54b0a9c6876f2c21aa8d19cf55962e
148148
refs/heads/autosynth-websecurityscanner: d4febbffb6c648b74faec62fe90e20adadc9a7d3
149149
refs/heads/bigquerystorage: 06db74d123d7f8a3ef48755c2fcabed09faf8e64

branches/autosynth-texttospeech/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,11 +907,11 @@ public boolean requesterPays(String bucketName) {
907907
// instead of true/false, this method returns true/null.
908908
Boolean isRP = storage.get(bucketName).requesterPays();
909909
return isRP != null && isRP.booleanValue();
910-
} catch (StorageException sex) {
911-
if (sex.getCode() == 400 && sex.getMessage().contains("Bucket is requester pays")) {
910+
} catch (StorageException ex) {
911+
if (ex.getCode() == 400 && ex.getMessage().contains("Bucket is requester pays")) {
912912
return true;
913913
}
914-
throw sex;
914+
throw ex;
915915
}
916916
}
917917

branches/autosynth-texttospeech/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public void testFileExistsRequesterPaysNoUserProject() throws IOException {
166166
// fails because we must pay for every access, including metadata.
167167
Files.exists(path);
168168
Assert.fail("It should have thrown an exception.");
169-
} catch (StorageException sex) {
170-
assertIsRequesterPaysException("testFileExistsRequesterPaysNoUserProject", sex);
169+
} catch (StorageException ex) {
170+
assertIsRequesterPaysException("testFileExistsRequesterPaysNoUserProject", ex);
171171
}
172172
}
173173

@@ -196,8 +196,8 @@ public void testCantCreateWithoutUserProject() throws IOException {
196196
// fails
197197
Files.write(path, "I would like to write".getBytes());
198198
Assert.fail("It should have thrown an exception.");
199-
} catch (StorageException sex) {
200-
assertIsRequesterPaysException("testCantCreateWithoutUserProject", sex);
199+
} catch (StorageException ex) {
200+
assertIsRequesterPaysException("testCantCreateWithoutUserProject", ex);
201201
}
202202
}
203203

@@ -218,8 +218,8 @@ public void testCantReadWithoutUserProject() throws IOException {
218218
// fails
219219
Files.readAllBytes(path);
220220
Assert.fail("It should have thrown an exception.");
221-
} catch (StorageException sex) {
222-
assertIsRequesterPaysException("testCantReadWithoutUserProject", sex);
221+
} catch (StorageException ex) {
222+
assertIsRequesterPaysException("testCantReadWithoutUserProject", ex);
223223
}
224224
}
225225

@@ -269,8 +269,8 @@ private void innerTestCantCopyWithoutUserProject(
269269
description,
270270
hex.getMessage()
271271
.contains("Bucket is requester pays bucket but no user project provided"));
272-
} catch (StorageException sex) {
273-
assertIsRequesterPaysException(description, sex);
272+
} catch (StorageException ex) {
273+
assertIsRequesterPaysException(description, ex);
274274
}
275275
}
276276

@@ -317,11 +317,11 @@ public void testAutodetectWhenNotRequesterPays() throws IOException {
317317
"");
318318
}
319319

320-
private void assertIsRequesterPaysException(String message, StorageException sex) {
321-
Assert.assertEquals(message, sex.getCode(), 400);
320+
private void assertIsRequesterPaysException(String message, StorageException ex) {
321+
Assert.assertEquals(message, ex.getCode(), 400);
322322
Assert.assertTrue(
323323
message,
324-
sex.getMessage().contains("Bucket is requester pays bucket but no user project provided"));
324+
ex.getMessage().contains("Bucket is requester pays bucket but no user project provided"));
325325
}
326326

327327
// End of tests related to the "requester pays" feature

0 commit comments

Comments
 (0)