Skip to content

Commit 6f3efbe

Browse files
authored
remove no-needed try blocks
1 parent 03a7134 commit 6f3efbe

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

plugins/storage/object/ECS/src/main/java/org/apache/cloudstack/storage/datastore/driver/EcsObjectStoreDriverImpl.java

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,9 @@ public Bucket createBucket(final Bucket bucket, final boolean objectLock) {
117117

118118
// Ensure per-account credentials exist (single-key policy with adopt-if-exists)
119119
ensureAccountUserAndSecret(accountId, ownerUser, cfg.mgmtUrl, cfg.saUser, cfg.saPass, cfg.ns, cfg.insecure);
120-
121-
// Quota from UI (INT GB). Bucket.getQuota may be Integer; Bucket.getSize may be Long.
122-
Integer quotaGb = null;
123-
try {
124-
quotaGb = bucket.getQuota();
125-
} catch (Throwable ignored) {
126-
}
127-
128-
if (quotaGb == null) {
129-
try {
130-
final Long sz = bucket.getSize();
131-
if (sz != null) {
132-
quotaGb = sz.intValue();
133-
}
134-
} catch (Throwable ignored) {
135-
}
136-
}
120+
121+
// Quota (INT GB)
122+
Integer quotaGb = bucket.getQuota();
137123

138124
final int blockSizeGb;
139125
final int notifSizeGb;
@@ -150,10 +136,7 @@ public Bucket createBucket(final Bucket bucket, final boolean objectLock) {
150136

151137
// Fallback to persisted value if request did not explicitly enable it.
152138
if (!encryptionEnabled) {
153-
try {
154-
encryptionEnabled = vo.isEncryption();
155-
} catch (Throwable ignored) {
156-
}
139+
encryptionEnabled = vo.isEncryption();
157140
}
158141

159142
logger.info("ECS createBucket flags for '{}': encryptionEnabled={}", name, encryptionEnabled);

0 commit comments

Comments
 (0)