Skip to content

Commit af78f0a

Browse files
committed
Fix #2886
1 parent 33f28a5 commit af78f0a

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java

+7-28
Original file line numberDiff line numberDiff line change
@@ -1068,23 +1068,13 @@ public JavaType uncheckedSimpleType(Class<?> cls) {
10681068
* type {@code List<Set<Integer>>}, you could
10691069
* call
10701070
*<pre>
1071-
* JavaType inner = TypeFactory.constructParametricType(Set.class, Set.class, Integer.class);
1072-
* return TypeFactory.constructParametricType(ArrayList.class, List.class, inner);
1071+
* JavaType inner = TypeFactory.constructParametricType(Set.class, Integer.class);
1072+
* return TypeFactory.constructParametricType(List.class, inner);
10731073
*</pre>
10741074
*<p>
1075-
* The reason for first two arguments to be separate is that parameterization may
1076-
* apply to a super-type. For example, if generic type was instead to be
1077-
* constructed for {@code ArrayList<Integer>}, the usual call would be:
1078-
*<pre>
1079-
* TypeFactory.constructParametricType(ArrayList.class, List.class, Integer.class);
1080-
*</pre>
1081-
* since parameterization is applied to {@link java.util.List}.
1082-
* In most cases distinction does not matter, but there are types where it does;
1083-
* one such example is parameterization of types that implement {@link java.util.Iterator}.
1084-
*<p>
1085-
* NOTE: type modifiers are NOT called on constructed type.
1075+
* NOTE: since 2.11.2 {@link TypeModifier}s ARE called on result (fix for [databind#2796])
10861076
*
1087-
* @param parametrized Actual full type
1077+
* @param parametrized Type-erased type to parameterize
10881078
* @param parameterClasses Type parameters to apply
10891079
*
10901080
* @since 2.5 NOTE: was briefly deprecated for 2.6
@@ -1103,20 +1093,10 @@ public JavaType constructParametricType(Class<?> parametrized, Class<?>... param
11031093
* represents a parameterized type. For example, to represent
11041094
* type {@code List<Set<Integer>>}, you could
11051095
*<pre>
1106-
* JavaType inner = TypeFactory.constructParametricType(Set.class, Set.class, Integer.class);
1107-
* return TypeFactory.constructParametricType(ArrayList.class, List.class, inner);
1096+
* JavaType inner = TypeFactory.constructParametricType(Set.class, Integer.class);
1097+
* return TypeFactory.constructParametricType(List.class, inner);
11081098
*</pre>
11091099
*<p>
1110-
* The reason for first two arguments to be separate is that parameterization may
1111-
* apply to a super-type. For example, if generic type was instead to be
1112-
* constructed for {@code ArrayList<Integer>}, the usual call would be:
1113-
*<pre>
1114-
* TypeFactory.constructParametricType(ArrayList.class, List.class, Integer.class);
1115-
*</pre>
1116-
* since parameterization is applied to {@link java.util.List}.
1117-
* In most cases distinction does not matter, but there are types where it does;
1118-
* one such example is parameterization of types that implement {@link java.util.Iterator}.
1119-
*<p>
11201100
* NOTE: since 2.11.2 {@link TypeModifier}s ARE called on result (fix for [databind#2796])
11211101
*
11221102
* @param rawType Actual type-erased type
@@ -1134,8 +1114,7 @@ public JavaType constructParametricType(Class<?> rawType, JavaType... parameterT
11341114
* represents a parameterized type. The type's parameters are
11351115
* specified as an instance of {@link TypeBindings}. This
11361116
* is useful if you already have the type's parameters such
1137-
* as those found on {@link JavaType}. For example, you could
1138-
* call
1117+
* as those found on {@link JavaType}. For example, you could call
11391118
* <pre>
11401119
* return TypeFactory.constructParametricType(ArrayList.class, javaType.getBindings());
11411120
* </pre>

0 commit comments

Comments
 (0)