Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd94dc6

Browse files
Dilip KrishnanDilip Krishnan
authored andcommitted
Optimized combiner logic
We only need to combine grouped entries that have more than one request handler. related to springfox#1780
1 parent b62754d commit cd94dc6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

springfox-spring-web/src/main/java/springfox/documentation/spring/web/plugins/DefaultRequestHandlerCombiner.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ private Collection<? extends RequestHandler> combined(Collection<RequestHandler>
6363
List<RequestHandler> handlers = groupByEquality.get(path);
6464

6565
RequestHandler toCombine = path.get();
66-
for (RequestHandler each : handlers) {
67-
toCombine = combine(toCombine, each);
66+
if (handlers.size() > 1) {
67+
for (RequestHandler each : handlers) {
68+
toCombine = combine(toCombine, each);
69+
}
6870
}
6971
combined.add(toCombine);
7072
}

0 commit comments

Comments
 (0)