Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static String getPackageName(String className) {
}

public static String upperFirst(String s) {
if (s == null || s.length() == 0) {
if (s == null || s.isEmpty()) {
return s;
}
return Character.toUpperCase(s.charAt(0)) + s.substring(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private static String filterBindMarker(CharSequence input) {
builder.append(ch);
}
}
if (builder.length() == 0) {
if (builder.isEmpty()) {
return "";
}
return "_" + builder.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ public void append(String path) {
@Override
@Nullable
public PathComponent build() {
if (this.path.length() == 0) {
if (this.path.isEmpty()) {
return null;
}
String sanitized = getSanitizedPath(this.path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public boolean matches(int pathIndex, PathPattern.MatchingContext matchingContex
return false;
}
String candidateCapture = matchingContext.pathElementValue(pathIndex);
if (candidateCapture.length() == 0) {
if (candidateCapture.isEmpty()) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
}
else {
return (matchingContext.isMatchOptionalTrailingSeparator() && // if optional slash is on...
segmentData != null && segmentData.length() > 0 && // and there is at least one character to match the *...
segmentData != null && !segmentData.isEmpty() && // and there is at least one character to match the *...
(pathIndex + 1) == matchingContext.pathLength && // and the next path element is the end of the candidate...
matchingContext.isSeparator(pathIndex)); // and the final element is a separator
}
}
}
else {
// Within a path (e.g. /aa/*/bb) there must be at least one character to match the wildcard
if (segmentData == null || segmentData.length() == 0) {
if (segmentData == null || segmentData.isEmpty()) {
return false;
}
return (this.next != null && this.next.matches(pathIndex, matchingContext));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ protected String createQueryString(List<Param> params, Set<String> usedParams, b
StringBuilder qs = new StringBuilder();
for (Param param : params) {
if (!usedParams.contains(param.getName()) && StringUtils.hasLength(param.getName())) {
if (includeQueryStringDelimiter && qs.length() == 0) {
if (includeQueryStringDelimiter && qs.isEmpty()) {
qs.append('?');
}
else {
Expand Down