Repository navigation
Fix two lines changed by mistake in the 4.22 merge #14767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -531,7 +531,7 @@ public GetUploadParamsResponse doInTransaction(TransactionStatus status) throws | |
| GetUploadParamsResponse response = new GetUploadParamsResponse(); | ||
|
|
||
| String ssvmUrlDomain = _configDao.getValue(Config.SecStorageSecureCopyCert.key()); | ||
| String protocol = UseHttpsToUpload.value() ? "https" : "http"; | ||
| String protocol = UseHttpsToUpload.valueIn(zoneId) ? "https" : "http"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please consider using the constants for "https" and "http" instead of hardcoded string literals.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept the literals on purpose. This PR only puts back |
||
|
|
||
| String url = ImageStoreUtil.generatePostUploadUrl(ssvmUrlDomain, ep.getPublicAddr(), vol.getUuid(), protocol); | ||
| response.setPostURL(new URL(url)); | ||
|
|
@@ -1819,10 +1819,10 @@ protected VolumeVO retrieveAndValidateVolume(long volumeId, Account caller) { | |
| * | ||
| * A volume can be destroyed if it is not in any of the following states. | ||
| * <ul> | ||
| * <li> {code}Volume.State#Destroy{code}; | ||
| * <li> {code}Volume.State#Expunging{code}; | ||
| * <li> {code}Volume.State#Expunged{code}; | ||
| * <li> {code}Volume.State#Allocated{code}. | ||
| * <li> {@code Volume.State#Destroy}; | ||
| * <li> {@code Volume.State#Expunging}; | ||
| * <li> {@code Volume.State#Expunged}; | ||
| * <li> {@code Volume.State#Allocated}. | ||
| * </ul> | ||
| * | ||
| * The volume is destroyed via {@link VolumeService#destroyVolume(long)} method. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapCapabilities can be empty, in this case get() and parseBoolean() calls do not add much value. While the performance impact is negligible, using a utility method such as isNotEmpty() would avoid executing the block when the map is either null or empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather leave this line as it is. The
if (mapCapabilities != null)block is unchanged from before the merge; this PR only restoresparseBoolean. The result is already the same either way: with an empty map,get()returns null andparseBoolean(null)is false, so it falls through toImage. I added a test for the null and empty map cases (see the test thread).