Skip to content

Commit 179bb15

Browse files
committed
Fix #2220 (documentation fix wrt ObjectMapper.convertValue())
1 parent 2a430e6 commit 179bb15

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

+15-8
Original file line numberDiff line numberDiff line change
@@ -3821,8 +3821,8 @@ public ObjectReader reader(TypeReference<?> type) {
38213821

38223822
/**
38233823
* Convenience method for doing two-step conversion from given value, into
3824-
* instance of given value type, if (but only if!) conversion is needed.
3825-
* If given value is already of requested type, value is returned as is.
3824+
* instance of given value type, by writing value into temporary buffer
3825+
* and reading from the buffer into specified target type.
38263826
*<p>
38273827
* This method is functionally similar to first
38283828
* serializing given value into JSON, and then binding JSON data into value
@@ -3831,14 +3831,21 @@ public ObjectReader reader(TypeReference<?> type) {
38313831
* However, same converters (serializers, deserializers) will be used as for
38323832
* data binding, meaning same object mapper configuration works.
38333833
*<p>
3834-
* Note that it is possible that in some cases behavior does differ from
3835-
* full serialize-then-deserialize cycle: in most case differences are
3836-
* unintentional (that is, flaws to fix) and should be reported.
3837-
* It is not guaranteed, however, that the behavior is 100% the same:
3838-
* the goal is just to allow efficient value conversions for structurally
3834+
* Note that behavior changed slightly between Jackson 2.9 and 2.10 so that
3835+
* whereas earlier some optimizations were used to avoid write/read cycle
3836+
* in case input was of target type, from 2.10 onwards full processing is
3837+
* always performed. See
3838+
* <a href="https://github.com/FasterXML/jackson-databind/issues/2220">databind#2220</a>
3839+
* for full details of the change.
3840+
*<p>
3841+
* Further note that it is possible that in some cases behavior does differ
3842+
* from full serialize-then-deserialize cycle: in most case differences are
3843+
* unintentional (that is, flaws to fix) and should be reported, but
3844+
* the behavior is not guaranteed to be 100% the same:
3845+
* the goal is to allow efficient value conversions for structurally
38393846
* compatible Objects, according to standard Jackson configuration.
38403847
*<p>
3841-
* Further note that functianality is not designed to support "advanced" use
3848+
* Finally, this functionality is not designed to support "advanced" use
38423849
* cases, such as conversion of polymorphic values, or cases where Object Identity
38433850
* is used.
38443851
*

0 commit comments

Comments
 (0)