Fix String concatenation in a loop

See gh-14153
This commit is contained in:
Hiroaki Yoshida
2018-08-20 16:47:16 -07:00
committed by Stephane Nicoll
parent 55406d91d2
commit 43acc37587

View File

@@ -317,11 +317,11 @@ public final class EndpointRequest {
public RequestMatcher antPath(RequestMatcherProvider matcherProvider,
String... parts) {
String pattern = this.prefix;
StringBuffer pattern = new StringBuffer(this.prefix);
for (String part : parts) {
pattern += part;
pattern.append(part);
}
return matcherProvider.getRequestMatcher(pattern);
return matcherProvider.getRequestMatcher(pattern.toString());
}
}