|
33 | 33 | import java.util.HashMap;
|
34 | 34 | import java.util.HashSet;
|
35 | 35 | import java.util.LinkedHashMap;
|
| 36 | +import java.util.LinkedHashSet; |
36 | 37 | import java.util.List;
|
37 | 38 | import java.util.Locale;
|
38 | 39 | import java.util.Map;
|
@@ -336,7 +337,7 @@ public Operation buildTags(HandlerMethod handlerMethod, Operation operation, Ope
|
336 | 337 | if (!CollectionUtils.isEmpty(tagsStr))
|
337 | 338 | tagsStr = tagsStr.stream()
|
338 | 339 | .map(str -> propertyResolverUtils.resolve(str, locale))
|
339 |
| - .collect(Collectors.toSet()); |
| 340 | + .collect(Collectors.toCollection(LinkedHashSet::new)); |
340 | 341 |
|
341 | 342 | if (springdocTags.containsKey(handlerMethod)) {
|
342 | 343 | io.swagger.v3.oas.models.tags.Tag tag = springdocTags.get(handlerMethod);
|
@@ -407,10 +408,10 @@ private void buildTagsFromMethod(Method method, Set<io.swagger.v3.oas.models.tag
|
407 | 408 | Set<Tags> tagsSet = AnnotatedElementUtils
|
408 | 409 | .findAllMergedAnnotations(method, Tags.class);
|
409 | 410 | Set<Tag> methodTags = tagsSet.stream()
|
410 |
| - .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); |
| 411 | + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toCollection(LinkedHashSet::new)); |
411 | 412 | methodTags.addAll(AnnotatedElementUtils.findAllMergedAnnotations(method, Tag.class));
|
412 | 413 | if (!CollectionUtils.isEmpty(methodTags)) {
|
413 |
| - tagsStr.addAll(methodTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toSet())); |
| 414 | + tagsStr.addAll(methodTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toCollection(LinkedHashSet::new))); |
414 | 415 | List<Tag> allTags = new ArrayList<>(methodTags);
|
415 | 416 | addTags(allTags, tags, locale);
|
416 | 417 | }
|
@@ -450,10 +451,10 @@ public void buildTagsFromClass(Class<?> beanType, Set<io.swagger.v3.oas.models.t
|
450 | 451 | Set<Tags> tagsSet = AnnotatedElementUtils
|
451 | 452 | .findAllMergedAnnotations(beanType, Tags.class);
|
452 | 453 | Set<Tag> classTags = tagsSet.stream()
|
453 |
| - .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); |
| 454 | + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toCollection(LinkedHashSet::new)); |
454 | 455 | classTags.addAll(AnnotatedElementUtils.findAllMergedAnnotations(beanType, Tag.class));
|
455 | 456 | if (!CollectionUtils.isEmpty(classTags)) {
|
456 |
| - tagsStr.addAll(classTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toSet())); |
| 457 | + tagsStr.addAll(classTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toCollection(LinkedHashSet::new))); |
457 | 458 | allTags.addAll(classTags);
|
458 | 459 | addTags(allTags, tags, locale);
|
459 | 460 | }
|
|
0 commit comments