Skip to content

Commit 0886ba7

Browse files
committed
Reduce indenting
1 parent 4feb87d commit 0886ba7

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

test/fixtures/gcs-fixture/src/main/java/fixture/gcs/MockGcsBlobStore.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,17 @@ BlobVersion getBlob(String path, Long ifGenerationMatch, Long generation) {
102102
final BlobVersion blob = blobs.get(path);
103103
if (blob == null) {
104104
throw new BlobNotFoundException(path);
105-
} else {
106-
if (generation != null && generation != blob.generation) {
107-
throw new BlobNotFoundException(blob.path, blob.generation);
108-
}
109-
if (ifGenerationMatch != null && ifGenerationMatch != blob.generation) {
110-
throw new GcsRestException(
111-
RestStatus.PRECONDITION_FAILED,
112-
"Generation mismatch, expected " + ifGenerationMatch + " but got " + blob.generation
113-
);
114-
}
115-
return blob;
116105
}
106+
if (generation != null && generation != blob.generation) {
107+
throw new BlobNotFoundException(blob.path, blob.generation);
108+
}
109+
if (ifGenerationMatch != null && ifGenerationMatch != blob.generation) {
110+
throw new GcsRestException(
111+
RestStatus.PRECONDITION_FAILED,
112+
"Generation mismatch, expected " + ifGenerationMatch + " but got " + blob.generation
113+
);
114+
}
115+
return blob;
117116
}
118117

119118
BlobVersion updateBlob(String path, Long ifGenerationMatch, BytesReference contents) {

0 commit comments

Comments
 (0)