Skip to content

Commit c1b4aad

Browse files
committed
Merge branch '2.15' into 2.16
2 parents 67103c2 + 6f81a4e commit c1b4aad

File tree

9 files changed

+34
-31
lines changed

9 files changed

+34
-31
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ public enum Type {
5959
* Usually this can be defined by using
6060
* {@link com.fasterxml.jackson.annotation.JsonManagedReference}
6161
*/
62-
MANAGED_REFERENCE
62+
MANAGED_REFERENCE,
6363

6464
/**
6565
* Reference property that Jackson manages by suppressing it during serialization,
6666
* and reconstructing during deserialization.
6767
* Usually this can be defined by using
6868
* {@link com.fasterxml.jackson.annotation.JsonBackReference}
6969
*/
70-
,BACK_REFERENCE
70+
BACK_REFERENCE
7171
;
7272
}
7373

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public enum MapperFeature implements ConfigFeature
322322
* Feature is enabled by default which means that deserialization does
323323
* support deserializing types via builders with type parameters (generic types).
324324
*<p>
325-
* See: https://github.com/FasterXML/jackson-databind/issues/921
325+
* See: <a href="https://github.com/FasterXML/jackson-databind/issues/921">databind#921</a>
326326
*
327327
* @since 2.12
328328
*/
@@ -401,6 +401,11 @@ public enum MapperFeature implements ConfigFeature
401401
*<p>
402402
* Note: does <b>not</b> apply to {@link java.util.Map} serialization (since
403403
* entries are not considered Bean/POJO properties.
404+
* <p>
405+
* WARNING: Disabling it may have a negative impact on deserialization performance.
406+
* When disabled, all properties before the last creator property in the input need to be buffered,
407+
* since all creator properties are required to create the instance.
408+
* Enabling this feature ensures that there is as little buffering as possible.
404409
*<p>
405410
* Feature is enabled by default.
406411
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4623,7 +4623,7 @@ public <T> T updateValue(T valueToUpdate, Object overrides)
46234623
* @param t The class to generate schema for
46244624
* @return Constructed JSON schema.
46254625
*
4626-
* @deprecated Since 2.6 use external JSON Schema generator (https://github.com/FasterXML/jackson-module-jsonSchema)
4626+
* @deprecated Since 2.6 use external JSON Schema generator (<a href="https://github.com/FasterXML/jackson-module-jsonSchema">jackson-module-jsonSchema</a>)
46274627
* (which under the hood calls {@link #acceptJsonFormatVisitor(JavaType, JsonFormatVisitorWrapper)})
46284628
*/
46294629
@Deprecated

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -947,19 +947,15 @@ public JsonSerializer<Object> getDefaultNullValueSerializer() {
947947
}
948948

949949
/**
950-
* Method called to get the serializer to use for serializing
951-
* Map keys that are nulls: this is needed since JSON does not allow
952-
* any non-String value as key, including null.
953-
*<p>
954-
* Typically, returned serializer
955-
* will either throw an exception, or use an empty String; but
956-
* other behaviors are possible.
957-
*/
958-
/**
959-
* Method called to find a serializer to use for null values for given
960-
* declared type. Note that type is completely based on declared type,
950+
* Method called to find a serializer to serializes Map keys that are nulls,
951+
* as JSON does not allow any non-String value as a key, including null.
952+
* Note that type is completely based on declared type,
961953
* since nulls in Java have no type and thus runtime type cannot be
962954
* determined.
955+
*
956+
* @return JsonSerializer that handles the serialization of null keys,
957+
* usually by throwing an exception or using an empty String,
958+
* but other behaviors are also possible.
963959
*
964960
* @since 2.0
965961
*/

src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ public void resolveForwardReference(Object id, Object value) throws IOException
529529

530530
/**
531531
* Helper class to maintain processing order of value. The resolved
532-
* object associated with {@link #_id} comes before the values in
533-
* {@link #next}.
532+
* object associated with {@code #id} parameter from {@link #handleResolvedForwardReference(Object, Object)}
533+
* comes before the values in {@link #next}.
534534
*/
535535
private final static class CollectionReferring extends Referring {
536536
private final CollectionReferringAccumulator _parent;

src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedClass.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ public static AnnotatedClass construct(JavaType type, MapperConfig<?> config,
202202
* Method similar to {@link #construct}, but that will NOT include
203203
* information from supertypes; only class itself and any direct
204204
* mix-ins it may have.
205-
*/
206-
/**
205+
*
207206
* @deprecated Since 2.9, use methods in {@link AnnotatedClassResolver} instead.
208207
*/
209208
@Deprecated

src/main/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public final class PrivateMaxEntriesMap<K, V> extends AbstractMap<K, V>
136136

137137
/**
138138
* The number of read buffers to use.
139-
* The max of 4 was introduced due to https://github.com/FasterXML/jackson-databind/issues/3665.
139+
* The max of 4 was introduced due to <a href="https://github.com/FasterXML/jackson-databind/issues/3665">databind#3665</a>.
140140
*/
141141
static final int NUMBER_OF_READ_BUFFERS = Math.min(4, ceilingNextPowerOfTwo(NCPU));
142142

@@ -145,7 +145,7 @@ public final class PrivateMaxEntriesMap<K, V> extends AbstractMap<K, V>
145145

146146
/**
147147
* The number of pending read operations before attempting to drain.
148-
* The threshold of 4 was introduced due to https://github.com/FasterXML/jackson-databind/issues/3665.
148+
* The threshold of 4 was introduced due to <a href="https://github.com/FasterXML/jackson-databind/issues/3665">databind#3665</a>.
149149
*/
150150
static final int READ_BUFFER_THRESHOLD = 4;
151151

src/test/java/com/fasterxml/jackson/databind/deser/dos/StreamReadStringConstraintsTest.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import com.fasterxml.jackson.databind.json.JsonMapper;
1010

1111
/**
12-
* Tests for {@a href="https://github.com/FasterXML/jackson-core/issues/863"}.
12+
* Tests for <a href="https://github.com/FasterXML/jackson-core/issues/863">databind#863</a>"
1313
*/
1414
public class StreamReadStringConstraintsTest extends BaseMapTest
1515
{
@@ -32,6 +32,8 @@ void setString(String string) {
3232
/**********************************************************************
3333
*/
3434

35+
private final static int TOO_LONG_STRING_VALUE = 20_100_000;
36+
3537
private final ObjectMapper MAPPER = newJsonMapper();
3638

3739
private ObjectMapper newJsonMapperWithUnlimitedStringSizeSupport() {
@@ -44,31 +46,32 @@ private ObjectMapper newJsonMapperWithUnlimitedStringSizeSupport() {
4446
public void testBigString() throws Exception
4547
{
4648
try {
47-
MAPPER.readValue(generateJson("string", 5001000), StringWrapper.class);
48-
fail("expected JsonMappingException");
49+
MAPPER.readValue(generateJson("string", TOO_LONG_STRING_VALUE), StringWrapper.class);
50+
fail("expected DatabindException");
4951
} catch (DatabindException e) {
50-
assertTrue("unexpected exception message: " + e.getMessage(),
51-
e.getMessage().startsWith("String value length (5001000) exceeds the maximum allowed (5000000"));
52+
final String message = e.getMessage();
53+
assertTrue("unexpected exception message: " + message, message.startsWith("String length"));
54+
assertTrue("unexpected exception message: " + message, message.contains("exceeds the maximum length ("));
5255
}
5356
}
5457

5558
public void testBiggerString() throws Exception
5659
{
5760
try {
58-
MAPPER.readValue(generateJson("string", 6_000_000), StringWrapper.class);
61+
MAPPER.readValue(generateJson("string", TOO_LONG_STRING_VALUE), StringWrapper.class);
5962
fail("expected JsonMappingException");
6063
} catch (DatabindException e) {
6164
final String message = e.getMessage();
6265
// this test fails when the TextBuffer is being resized, so we don't yet know just how big the string is
6366
// so best not to assert that the String length value in the message is the full 6000000 value
64-
assertTrue("unexpected exception message: " + message, message.startsWith("String value length"));
65-
assertTrue("unexpected exception message: " + message, message.contains("exceeds the maximum allowed (5000000"));
67+
assertTrue("unexpected exception message: " + message, message.startsWith("String length"));
68+
assertTrue("unexpected exception message: " + message, message.contains("exceeds the maximum length ("));
6669
}
6770
}
6871

6972
public void testUnlimitedString() throws Exception
7073
{
71-
final int len = 5_001_000;
74+
final int len = TOO_LONG_STRING_VALUE;
7275
StringWrapper sw = newJsonMapperWithUnlimitedStringSizeSupport()
7376
.readValue(generateJson("string", len), StringWrapper.class);
7477
assertEquals(len, sw.string.length());

src/test/java/com/fasterxml/jackson/databind/jsontype/TestPolymorphicDeserialization676.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.*;
99

1010
/**
11-
* Reproduction of [https://github.com/FasterXML/jackson-databind/issues/676]
11+
* Reproduction of <a href="https://github.com/FasterXML/jackson-databind/issues/676">databind#676</a>
1212
* <p/>
1313
* Deserialization of class with generic collection inside
1414
* depends on how is was deserialized first time.

0 commit comments

Comments
 (0)