Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jackson 2.18.2 #639

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ updates.ignore = [

updates.pin = [
# pin to jackson version used in pekko-core
{ groupId = "com.fasterxml.jackson.core", version = "2.17." },
{ groupId = "com.fasterxml.jackson.dataformat", version = "2.17." },
{ groupId = "com.fasterxml.jackson.core", version = "2.18." },
{ groupId = "com.fasterxml.jackson.dataformat", version = "2.18." },
# https://github.com/akka/akka-http/pull/3995#issuecomment-1009951997
{ groupId = "org.scala-lang.modules", artifactId = "scala-xml", version = "1." },
# https://github.com/akka/akka-http/pull/3996#issuecomment-1009953070
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static ObjectMapper createMapper(final Config config) {
.maxStringLength(config.getInt("read.max-string-length"))
.maxNameLength(config.getInt("read.max-name-length"))
.maxDocumentLength(config.getLong("read.max-document-length"))
.maxTokenCount(config.getLong("read.max-token-count"))
.build();
StreamWriteConstraints streamWriteConstraints =
StreamWriteConstraints.builder()
Expand All @@ -126,16 +127,14 @@ private static RecyclerPool<BufferRecycler> getBufferRecyclerPool(final Config c
switch (poolType) {
case "thread-local":
return JsonRecyclerPools.threadLocalPool();
case "lock-free":
return JsonRecyclerPools.newLockFreePool();
case "shared-lock-free":
return JsonRecyclerPools.sharedLockFreePool();
case "concurrent-deque":
return JsonRecyclerPools.newConcurrentDequePool();
case "shared-concurrent-deque":
return JsonRecyclerPools.sharedConcurrentDequePool();
case "bounded":
return JsonRecyclerPools.newBoundedPool(cfg.getInt("buffer-recycler.bounded-pool-size"));
case "non-recycling":
return JsonRecyclerPools.nonRecyclingPool();
default:
throw new IllegalArgumentException("Unknown recycler-pool: " + poolType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@

pekko.http.marshallers.jackson {
read {
# see https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.17.1/com/fasterxml/jackson/core/StreamReadConstraints.html
# see https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.18.2/com/fasterxml/jackson/core/StreamReadConstraints.html
# these defaults are the same as the defaults in `StreamReadConstraints`
max-nesting-depth = 1000
max-number-length = 1000
max-string-length = 20000000
max-name-length = 50000
# max-document-length of -1 means unlimited
max-document-length = -1
# max-token-count of -1 means unlimited
max-token-count = -1
}

write {
# see https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.17.1/com/fasterxml/jackson/core/StreamWriteConstraints.html
# see https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.18.2/com/fasterxml/jackson/core/StreamWriteConstraints.html
# these defaults are the same as the defaults in `StreamWriteConstraints`
max-nesting-depth = 1000
}

# Controls the Buffer Recycler Pool implementation used by Jackson.
# https://javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.17.1/com/fasterxml/jackson/core/util/JsonRecyclerPools.html
# The default is "thread-local" which is the same as the default in Jackson 2.16.
# https://javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.18.2/com/fasterxml/jackson/core/util/JsonRecyclerPools.html
# The default is "thread-local" which is the same as the default in Jackson 2.18.
buffer-recycler {
# the supported values are "thread-local", "lock-free", "shared-lock-free", "concurrent-deque",
# "shared-concurrent-deque", "bounded"
# the supported values are "thread-local", "concurrent-deque", "shared-concurrent-deque", "bounded", "non-recycling"
pool-instance = "thread-local"
# the maximum size of bounded recycler pools - must be >=1 or an IllegalArgumentException will occur
# only applies to pool-instance type "bounded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public void configStreamReadsConstraints() throws Exception {
final int maxNameLen = 54321;
final int maxStringLen = 1234567;
final long maxDocLen = 123456789L;
final long maxTokenCount = 9876543210L;
final int maxNestingDepth = 5;
String configText =
"read.max-number-length="
Expand All @@ -108,6 +109,9 @@ public void configStreamReadsConstraints() throws Exception {
+ "read.max-document-length="
+ maxDocLen
+ "\n"
+ "read.max-token-count="
+ maxTokenCount
+ "\n"
+ "read.max-nesting-depth="
+ maxNestingDepth;
Config config = ConfigFactory.parseString(configText).withFallback(getDefaultConfig());
Expand All @@ -117,6 +121,7 @@ public void configStreamReadsConstraints() throws Exception {
assertEquals(maxNameLen, constraints.getMaxNameLength());
assertEquals(maxStringLen, constraints.getMaxStringLength());
assertEquals(maxDocLen, constraints.getMaxDocumentLength());
assertEquals(maxTokenCount, constraints.getMaxTokenCount());
assertEquals(maxNestingDepth, constraints.getMaxNestingDepth());
}

Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import scala.language.implicitConversions
object Dependencies {
import DependencyHelpers._

val jacksonDatabindVersion = "2.17.3"
val jacksonDatabindVersion = "2.18.2"
val jacksonXmlVersion = jacksonDatabindVersion
val junitVersion = "4.13.2"
val h2specVersion = "2.6.0"
Expand Down
Loading