|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
24 | 24 | import java.util.List;
|
25 | 25 | import java.util.Map;
|
26 | 26 | import java.util.Optional;
|
27 |
| -import java.util.Set; |
28 | 27 |
|
29 | 28 | import jakarta.validation.Constraint;
|
30 | 29 | import jakarta.validation.ConstraintValidator;
|
@@ -127,7 +126,7 @@ void shouldProcessTransitiveGenericTypeLevelConstraint() {
|
127 | 126 | }
|
128 | 127 |
|
129 | 128 | @ParameterizedTest // gh-33936
|
130 |
| - @ValueSource(classes = {BeanWithIterable.class, BeanWithMap.class, BeanWithOptional.class}) |
| 129 | + @ValueSource(classes = {BeanWithRecursiveIterable.class, BeanWithRecursiveMap.class, BeanWithRecursiveOptional.class}) |
131 | 130 | void shouldProcessRecursiveGenericsWithoutInfiniteRecursion(Class<?> beanClass) {
|
132 | 131 | process(beanClass);
|
133 | 132 | assertThat(this.generationContext.getRuntimeHints().reflection().typeHints()).hasSize(1);
|
@@ -258,16 +257,16 @@ public void setExclude(List<Exclude> exclude) {
|
258 | 257 | }
|
259 | 258 | }
|
260 | 259 |
|
261 |
| - static class BeanWithIterable { |
262 |
| - private final Iterable<BeanWithIterable> beans = Set.of(); |
| 260 | + static class BeanWithRecursiveIterable { |
| 261 | + Iterable<BeanWithRecursiveIterable> iterable; |
263 | 262 | }
|
264 | 263 |
|
265 |
| - static class BeanWithMap { |
266 |
| - private final Map<String, BeanWithMap> beans = Map.of(); |
| 264 | + static class BeanWithRecursiveMap { |
| 265 | + Map<BeanWithRecursiveMap, BeanWithRecursiveMap> map; |
267 | 266 | }
|
268 | 267 |
|
269 |
| - static class BeanWithOptional { |
270 |
| - private final Optional<BeanWithOptional> beans = Optional.empty(); |
| 268 | + static class BeanWithRecursiveOptional { |
| 269 | + Optional<BeanWithRecursiveOptional> optional; |
271 | 270 | }
|
272 | 271 |
|
273 | 272 | }
|
0 commit comments