Commit b5c3c33b authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #14024 from izeye:polish-item-metadata-build-name

* pr/14024:
  Polish ItemMetadata.buildName()
parents 243278d5 05a7d213
...@@ -58,14 +58,17 @@ public final class ItemMetadata implements Comparable<ItemMetadata> { ...@@ -58,14 +58,17 @@ public final class ItemMetadata implements Comparable<ItemMetadata> {
} }
private String buildName(String prefix, String name) { private String buildName(String prefix, String name) {
while (prefix != null && prefix.endsWith(".")) { StringBuilder fullName = new StringBuilder();
prefix = prefix.substring(0, prefix.length() - 1); if (prefix != null) {
} if (prefix.endsWith(".")) {
StringBuilder fullName = new StringBuilder((prefix != null) ? prefix : ""); prefix = prefix.substring(0, prefix.length() - 1);
if (fullName.length() > 0 && name != null) { }
fullName.append('.'); fullName.append(prefix);
} }
if (name != null) { if (name != null) {
if (fullName.length() > 0) {
fullName.append('.');
}
fullName.append(ConfigurationMetadata.toDashedCase(name)); fullName.append(ConfigurationMetadata.toDashedCase(name));
} }
return fullName.toString(); return fullName.toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment