Skip to content

Commit b70b320

Browse files
committed
fix some pmd warnings
1 parent 754af3d commit b70b320

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/main/java/org/htmlunit/javascript/host/css/CSS.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,32 +73,25 @@ public static String escape(final String ident) {
7373
// If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F,
7474
// then the character escaped as code point.
7575
else if (('\u0001' <= c && c <= '\u001f') || c == '\u007f') {
76-
escaped.append('\\');
77-
escaped.append(Integer.toHexString(c));
78-
escaped.append(' ');
76+
escaped.append('\\').append(Integer.toHexString(c)).append(' ');
7977
}
8078

8179
// If the character is the first character and is in the range [0-9] (U+0030 to U+0039),
8280
// then the character escaped as code point.
8381
else if (i == 0 && ('\u0030' <= c && c <= '\u0039')) {
84-
escaped.append('\\');
85-
escaped.append(Integer.toHexString(c));
86-
escaped.append(' ');
82+
escaped.append('\\').append(Integer.toHexString(c)).append(' ');
8783
}
8884

8985
// If the character is the second character and is in the range [0-9] (U+0030 to U+0039)
9086
// and the first character is a "-" (U+002D), then the character escaped as code point.
9187
else if (i == 1 && ('\u0030' <= c && c <= '\u0039') && ident.charAt(0) == '-') {
92-
escaped.append('\\');
93-
escaped.append(Integer.toHexString(c));
94-
escaped.append(' ');
88+
escaped.append('\\').append(Integer.toHexString(c)).append(' ');
9589
}
9690

9791
// If the character is the first character and is a "-" (U+002D),
9892
// and there is no second character, then the escaped character.
9993
else if (i == 0 && c == '-' && length == 1) {
100-
escaped.append('\\');
101-
escaped.append(c);
94+
escaped.append('\\').append(c);
10295
}
10396

10497
// If the character is not handled by one of the above rules
@@ -117,8 +110,7 @@ else if (c >= '\u0080'
117110

118111
// Otherwise, the escaped character
119112
else {
120-
escaped.append('\\');
121-
escaped.append(c);
113+
escaped.append('\\').append(c);
122114
}
123115
}
124116

src/main/java/org/htmlunit/javascript/host/css/CSSStyleDeclaration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,7 @@ private void updateFont(final String font, final boolean force) {
833833
}
834834

835835
if (!lineHeight.equals(defaultLineHeight)) {
836-
newFont.append('/');
837-
newFont.append(lineHeight);
836+
newFont.append('/').append(lineHeight);
838837
}
839838

840839
newFont.append(' ').append(getFontFamily());

0 commit comments

Comments
 (0)