Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,13 @@ protected RequestFactory createRequestFactory() {
try {
storageClass = StorageClass.fromValue(storageClassConf);
} catch (IllegalArgumentException e) {
LOG.warn("Unknown storage class property {}: {}; falling back to default storage class",
STORAGE_CLASS, storageClassConf);
if (storageClassConf.length() == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do storageClassConf.isEmpty() rather than calculating the length.
BTW. If it is empty you need not to attempt storageClass = StorageClass.fromValue(storageClassConf); and then land up with this Exception handling

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, much cleaner approach

LOG.info("Unknown storage class property {}: {}; falling back to default storage class",
STORAGE_CLASS, storageClassConf);
} else {
LOG.warn("Unknown storage class property {}: {}; falling back to default storage class",
STORAGE_CLASS, storageClassConf);
}
storageClass = null;
}

Expand Down