mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-04 08:13:20 +00:00
pmd:AppendCharacterWithChar - Append Character With Char
This commit is contained in:
1 parent
59c32d3937
commit
7adefc89ba
3 files changed
+7
-7
No files matched your search
@@ -71,10 +71,10 @@ public class Hero {
|
||||
if (hairColor != null || hairType != null) {
|
||||
sb.append(" with ");
|
||||
if (hairColor != null) {
|
||||
sb.append(hairColor).append(" ");
|
||||
sb.append(hairColor).append(' ');
|
||||
}
|
||||
if (hairType != null) {
|
||||
sb.append(hairType).append(" ");
|
||||
sb.append(hairType).append(' ');
|
||||
}
|
||||
sb.append(hairType != HairType.BALD ? "hair" : "head");
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class Hero {
|
||||
if (weapon != null) {
|
||||
sb.append(" and wielding a ").append(weapon);
|
||||
}
|
||||
sb.append(".");
|
||||
sb.append('.');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user