Gargi-jais11 commented on code in PR #10007:
URL: https://github.com/apache/ozone/pull/10007#discussion_r3019689739
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/BucketHandler.java:
##########
@@ -99,6 +99,7 @@ public abstract OmDirectoryInfo getDirInfo(String[] names)
* @param nextLevel
* @return subpath
*/
+ @SuppressWarnings("PMD.UseStringBufferForStringAppends")
Review Comment:
Why to do suppression over here? If we are applying this as a rule we should
refactor this as well as the change is not very complex.
```
public static String buildSubpath(String path, String nextLevel) {
StringBuilder sb = new StringBuilder();
if (!path.startsWith(OM_KEY_PREFIX)) {
sb.append(OM_KEY_PREFIX);
}
sb.append(path);
String normalized = removeTrailingSlashIfNeeded(sb.toString());
if (nextLevel == null) {
return normalized;
}
return new StringBuilder(normalized)
.append(OM_KEY_PREFIX)
.append(nextLevel)
.toString();
}
```
##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/nssummary/DiskUsageSubCommand.java:
##########
@@ -84,6 +84,7 @@ public class DiskUsageSubCommand implements Callable {
private static final int PATH_INDENT = 27;
@Override
+ @SuppressWarnings(value = "PMD.UseStringBufferForStringAppends")
Review Comment:
I think no need of suppression here as well. Just need to change these below
lines 166 - 170 in this method:
```
String subPath = subPathDU.path("path").asText("");
// differentiate key from other types
if (!subPathDU.path("isKey").asBoolean(false)) {
subPath += OM_KEY_PREFIX;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]