@@ -758,7 +758,7 @@ public ObjectReader with(FormatSchema schema)
758
758
* Method for constructing a new reader instance that is configured
759
759
* to data bind into specified type.
760
760
*<p>
761
- * Note that the method does NOT change state of this reader, but
761
+ * Note that the method does not change state of this reader, but
762
762
* rather construct and returns a newly configured instance.
763
763
*
764
764
* @since 2.5
@@ -782,7 +782,7 @@ public ObjectReader forType(JavaType valueType)
782
782
* Method for constructing a new reader instance that is configured
783
783
* to data bind into specified type.
784
784
*<p>
785
- * Note that the method does NOT change state of this reader, but
785
+ * Note that the method does not change state of this reader, but
786
786
* rather construct and returns a newly configured instance.
787
787
*
788
788
* @since 2.5
@@ -795,7 +795,27 @@ public ObjectReader forType(Class<?> valueType) {
795
795
* Method for constructing a new reader instance that is configured
796
796
* to data bind into specified type.
797
797
*<p>
798
- * Note that the method does NOT change state of this reader, but
798
+ * <b>WARNING!</b> Note that type resolution from {@link java.lang.reflect.Type}
799
+ * may fail to properly resolve generic type declarations because it does not
800
+ * pass any context (like {@code Field} or {@code Method} it is included for;
801
+ * or encloding {@link Class}).
802
+ * For this reason you should only use this method if you really know what
803
+ * you are doing.
804
+ *<p>
805
+ * Note that the method does not change state of this reader, but
806
+ * rather construct and returns a newly configured instance.
807
+ *
808
+ * @since 2.16
809
+ */
810
+ public ObjectReader forType (java .lang .reflect .Type valueType ) {
811
+ return forType (_config .getTypeFactory ().constructType (valueType ));
812
+ }
813
+
814
+ /**
815
+ * Method for constructing a new reader instance that is configured
816
+ * to data bind into specified type.
817
+ *<p>
818
+ * Note that the method does not change state of this reader, but
799
819
* rather construct and returns a newly configured instance.
800
820
*
801
821
* @since 2.5
@@ -821,7 +841,7 @@ public ObjectReader withType(Class<?> valueType) {
821
841
}
822
842
823
843
/**
824
- * @deprecated since 2.5 Use {@link #forType(Class )} instead
844
+ * @deprecated since 2.5 Use {@link #forType(java.lang.reflect.Type )} instead
825
845
*/
826
846
@ Deprecated
827
847
public ObjectReader withType (java .lang .reflect .Type valueType ) {
0 commit comments