Skip to content

Commit d6bf681

Browse files
committed
Upgrade dependencies; prepare for release
* Upgrade to Gradle `7.3.3` * Upgrade to the latest milestones for releasing * Upgrade to Kryo-5.2.1 and update source code according breaking changes * Upgrade to H2-2.1.210 and re-enable respective stored procedure tests
1 parent c28e251 commit d6bf681

File tree

12 files changed

+94
-82
lines changed

12 files changed

+94
-82
lines changed

build.gradle

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ buildscript {
1515
plugins {
1616
id 'org.sonarqube' version '2.8'
1717
id 'io.spring.nohttp' version '0.0.10' apply false
18-
id 'org.ajoberstar.grgit' version '4.1.0'
18+
id 'org.ajoberstar.grgit' version '4.1.1'
1919
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
20-
id 'com.jfrog.artifactory' version '4.24.20' apply false
20+
id 'com.jfrog.artifactory' version '4.26.1' apply false
2121
id 'org.jetbrains.dokka' version '1.6.10'
2222
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
2323
id 'org.asciidoctor.jvm.gems' version '3.3.2'
@@ -48,64 +48,64 @@ ext {
4848
files(grgit.status().unstaged.modified).filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
4949

5050
apacheSshdVersion = '2.8.0'
51-
artemisVersion = '2.19.0'
52-
aspectjVersion = '1.9.7'
53-
assertjVersion = '3.21.0'
51+
artemisVersion = '2.20.0'
52+
aspectjVersion = '1.9.8.RC3'
53+
assertjVersion = '3.22.0'
5454
assertkVersion = '0.25'
55-
avroVersion = '1.10.2'
55+
avroVersion = '1.11.0'
5656
awaitilityVersion = '4.1.1'
5757
commonsDbcp2Version = '2.9.0'
5858
commonsIoVersion = '2.11.0'
5959
commonsNetVersion = '3.8.0'
6060
curatorVersion = '4.3.0'
6161
derbyVersion = '10.14.2.0'
62-
ftpServerVersion = '1.1.1'
62+
ftpServerVersion = '1.1.2'
6363
googleJsr305Version = '3.0.2'
6464
greenmailVersion = '2.0.0-alpha-2'
6565
groovyVersion = '3.0.9'
6666
hamcrestVersion = '2.2'
6767
hazelcastVersion = '5.0.2'
68-
hibernateVersion = '5.6.1.Final'
69-
hsqldbVersion = '2.6.0'
70-
h2Version = '2.0.206'
71-
jacksonVersion = '2.13.0'
68+
hibernateVersion = '5.6.3.Final'
69+
hsqldbVersion = '2.6.1'
70+
h2Version = '2.1.210'
71+
jacksonVersion = '2.13.1'
7272
jaxbVersion = '3.0.2'
7373
jeroMqVersion = '0.5.2'
7474
jmsApiVersion = '3.0.0'
7575
jpaApiVersion = '3.0.2'
76-
jrubyVersion = '9.2.19.0'
76+
jrubyVersion = '9.3.2.0'
7777
jschVersion = '0.1.55'
7878
jsonpathVersion = '2.6.0'
7979
junit4Version = '4.13.2'
80-
junitJupiterVersion = '5.8.1'
80+
junitJupiterVersion = '5.8.2'
8181
jythonVersion = '2.7.2'
82-
kryoShadedVersion = '4.0.2'
83-
lettuceVersion = '6.1.5.RELEASE'
84-
log4jVersion = '2.17.0'
82+
kryoVersion = '5.2.1'
83+
lettuceVersion = '6.1.6.RELEASE'
84+
log4jVersion = '2.17.1'
8585
mailVersion = '2.0.1'
86-
micrometerVersion = '1.7.7'
87-
mockitoVersion = '4.0.0'
88-
mongoDriverVersion = '4.4.0'
89-
mysqlVersion = '8.0.27'
86+
micrometerVersion = '2.0.0-M1'
87+
mockitoVersion = '4.2.0'
88+
mongoDriverVersion = '4.4.1'
89+
mysqlVersion = '8.0.28'
9090
pahoMqttClientVersion = '1.2.5'
91-
postgresVersion = '42.2.23'
92-
r2dbch2Version = '0.9.0.M1'
93-
reactorVersion = '2020.0.14'
91+
postgresVersion = '42.3.1'
92+
r2dbch2Version = '0.9.0.RELEASE'
93+
reactorVersion = '2020.0.15'
9494
resilience4jVersion = '1.7.1'
95-
romeToolsVersion = '1.16.0'
95+
romeToolsVersion = '1.18.0'
9696
rsocketVersion = '1.1.1'
9797
saajVersion = '2.0.1'
9898
servletApiVersion = '5.0.0'
9999
smackVersion = '4.3.5'
100-
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '3.0.0-SNAPSHOT'
101-
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2022.1.0-SNAPSHOT'
102-
springKafkaVersion = '3.0.0-SNAPSHOT'
100+
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '3.0.0-M1'
101+
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2022.0.0-M1'
102+
springKafkaVersion = '3.0.0-M1'
103103
springRetryVersion = '1.3.1'
104-
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '6.0.0-SNAPSHOT'
105-
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.0-SNAPSHOT'
106-
springWsVersion = '4.0.0-SNAPSHOT'
104+
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '6.0.0-M1'
105+
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.0-M2'
106+
springWsVersion = '4.0.0-M1'
107107
testcontainersVersion = '1.16.2'
108-
tomcatVersion = '10.0.11'
108+
tomcatVersion = '10.0.14'
109109
xmlUnitVersion = '2.8.4'
110110
xstreamVersion = '1.4.18'
111111

@@ -357,7 +357,7 @@ configure(javaProjects) { subproject ->
357357

358358
checkstyle {
359359
configDirectory.set(rootProject.file('src/checkstyle'))
360-
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '9.2'
360+
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '9.2.1'
361361
}
362362

363363
jar {
@@ -497,7 +497,7 @@ project('spring-integration-core') {
497497
}
498498

499499
optionalApi "com.jayway.jsonpath:json-path:$jsonpathVersion"
500-
optionalApi "com.esotericsoftware:kryo-shaded:$kryoShadedVersion"
500+
optionalApi "com.esotericsoftware:kryo:$kryoVersion"
501501
optionalApi "io.micrometer:micrometer-core:$micrometerVersion"
502502
optionalApi "io.github.resilience4j:resilience4j-ratelimiter:$resilience4jVersion"
503503
optionalApi "org.apache.avro:avro:$avroVersion"
@@ -657,7 +657,7 @@ project('spring-integration-ip') {
657657
testImplementation project(':spring-integration-event')
658658
testImplementation "org.hamcrest:hamcrest-core:$hamcrestVersion"
659659

660-
testRuntimeOnly "com.esotericsoftware:kryo-shaded:$kryoShadedVersion"
660+
testRuntimeOnly "com.esotericsoftware:kryo:$kryoVersion"
661661
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
662662
}
663663

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionSha256Sum=23b89f8eac363f5f4b8336e0530c7295c55b728a9caa5268fdd4a532610d5392
6+
distributionSha256Sum=b586e04868a22fd817c8971330fec37e298f3242eb85c374181b12d637f80302

spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoCodec.java

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2020 the original author or authors.
2+
* Copyright 2015-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,69 +27,71 @@
2727
import com.esotericsoftware.kryo.Kryo;
2828
import com.esotericsoftware.kryo.io.Input;
2929
import com.esotericsoftware.kryo.io.Output;
30-
import com.esotericsoftware.kryo.pool.KryoFactory;
31-
import com.esotericsoftware.kryo.pool.KryoPool;
30+
import com.esotericsoftware.kryo.util.Pool;
3231

3332
/**
3433
* Base class for {@link Codec}s using {@link Kryo}.
3534
* Manages pooled {@link Kryo} instances.
3635
*
3736
* @author David Turanski
37+
* @author Artem Bilan
38+
*
3839
* @since 4.2
3940
*/
4041
public abstract class AbstractKryoCodec implements Codec {
4142

42-
protected final KryoPool pool; // NOSONAR final
43+
protected final Pool<Kryo> pool; // NOSONAR final
4344

4445
protected AbstractKryoCodec() {
45-
KryoFactory factory = () -> {
46-
Kryo kryo = new Kryo();
47-
kryo.setRegistrationRequired(true);
48-
// configure Kryo instance, customize settings
49-
configureKryoInstance(kryo);
50-
return kryo;
46+
this.pool = new Pool<>(true, true) {
47+
48+
@Override
49+
protected Kryo create() {
50+
Kryo kryo = new Kryo();
51+
kryo.setRegistrationRequired(true);
52+
// configure Kryo instance, customize settings
53+
configureKryoInstance(kryo);
54+
return kryo;
55+
}
56+
5157
};
52-
// Build pool with SoftReferences enabled (optional)
53-
this.pool = new KryoPool.Builder(factory).softReferences().build();
5458
}
5559

5660
@Override
5761
public void encode(final Object object, OutputStream outputStream) {
5862
Assert.notNull(object, "cannot encode a null object");
5963
Assert.notNull(outputStream, "'outputSteam' cannot be null");
60-
final Output output = (outputStream instanceof Output ? (Output) outputStream : new Output(outputStream));
61-
this.pool.run(kryo -> {
64+
65+
Kryo kryo = this.pool.obtain();
66+
try (Output output = (outputStream instanceof Output ? (Output) outputStream : new Output(outputStream))) {
6267
doEncode(kryo, object, output);
63-
return Void.class;
64-
});
65-
output.close();
68+
}
69+
finally {
70+
this.pool.free(kryo);
71+
}
72+
6673
}
6774

6875
@Override
6976
public <T> T decode(byte[] bytes, Class<T> type) throws IOException {
7077
Assert.notNull(bytes, "'bytes' cannot be null");
71-
final Input input = new Input(bytes);
72-
try {
78+
try (Input input = new Input(bytes)) {
7379
return decode(input, type);
7480
}
75-
finally {
76-
input.close();
77-
}
7881
}
7982

8083
@Override
8184
public <T> T decode(InputStream inputStream, final Class<T> type) {
8285
Assert.notNull(inputStream, "'inputStream' cannot be null");
8386
Assert.notNull(type, "'type' cannot be null");
84-
final Input input = (inputStream instanceof Input ? (Input) inputStream : new Input(inputStream));
85-
T result = null;
86-
try {
87-
result = this.pool.run(kryo -> doDecode(kryo, input, type));
87+
88+
Kryo kryo = this.pool.obtain();
89+
try (Input input = (inputStream instanceof Input ? (Input) inputStream : new Input(inputStream))) {
90+
return doDecode(kryo, input, type);
8891
}
8992
finally {
90-
input.close();
93+
this.pool.free(kryo);
9194
}
92-
return result;
9395
}
9496

9597
@Override

spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoRegistrar.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2020 the original author or authors.
2+
* Copyright 2015-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,6 +34,10 @@ public abstract class AbstractKryoRegistrar implements KryoRegistrar {
3434

3535
protected static final Kryo KRYO = new Kryo();
3636

37+
static {
38+
KRYO.setRegistrationRequired(false);
39+
}
40+
3741
protected final Log log = LogFactory.getLog(getClass()); // NOSONAR property is final
3842

3943
@Override

spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/FileSerializer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,6 +30,8 @@
3030
* is declared transient.
3131
*
3232
* @author David Turanski
33+
* @author Artem Bilan
34+
*
3335
* @since 4.2
3436
*/
3537
public class FileSerializer extends Serializer<File> {
@@ -40,8 +42,8 @@ public void write(Kryo kryo, Output output, File file) {
4042
}
4143

4244
@Override
43-
public File read(Kryo kryo, Input input, Class<File> type) {
44-
String path = input.readString();
45+
public File read(Kryo kryo, Input input, Class<? extends File> type) {
46+
String path = input.readString();
4547
return new File(path);
4648
}
4749

spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/MessageHeadersSerializer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,13 +28,17 @@
2828

2929
/**
3030
* Kryo Serializer for {@link MessageHeaders}.
31+
*
3132
* @author David Turanski
33+
* @author Artem Bilan
34+
*
3235
* @since 4.2
3336
*/
3437
class MessageHeadersSerializer extends Serializer<MessageHeaders> {
38+
3539
@Override
3640
public void write(Kryo kryo, Output output, MessageHeaders headers) {
37-
HashMap<String, Object> map = new HashMap<String, Object>();
41+
HashMap<String, Object> map = new HashMap<>();
3842
for (Map.Entry<String, Object> entry : headers.entrySet()) {
3943
if (entry.getValue() != null) {
4044
map.put(entry.getKey(), entry.getValue());
@@ -44,7 +48,7 @@ public void write(Kryo kryo, Output output, MessageHeaders headers) {
4448
}
4549

4650
@Override
47-
public MessageHeaders read(Kryo kryo, Input input, Class<MessageHeaders> type) {
51+
public MessageHeaders read(Kryo kryo, Input input, Class<? extends MessageHeaders> type) {
4852
@SuppressWarnings("unchecked")
4953
Map<String, Object> headers = kryo.readObject(input, HashMap.class);
5054
return new MessageHeaders(headers);

spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/MutableMessageHeadersSerializer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,13 +27,16 @@
2727

2828
/**
2929
* Kryo Serializer for {@link MutableMessageHeaders}.
30+
*
3031
* @author David Turanski
32+
* @author Artem Bilan
33+
*
3134
* @since 4.2
3235
*/
3336
class MutableMessageHeadersSerializer extends MessageHeadersSerializer {
3437

3538
@Override
36-
public MessageHeaders read(Kryo kryo, Input input, Class<MessageHeaders> type) {
39+
public MessageHeaders read(Kryo kryo, Input input, Class<? extends MessageHeaders> type) {
3740
@SuppressWarnings("unchecked")
3841
Map<String, Object> headers = kryo.readObject(input, HashMap.class);
3942
return new MutableMessageHeaders(headers);

spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/PojoCodec.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626
import com.esotericsoftware.kryo.Kryo;
2727
import com.esotericsoftware.kryo.io.Input;
2828
import com.esotericsoftware.kryo.io.Output;
29+
import com.esotericsoftware.kryo.util.DefaultInstantiatorStrategy;
2930

3031
/**
3132
* Kryo Codec that can encode and decode arbitrary types. Classes and associated
@@ -34,6 +35,7 @@
3435
*
3536
* @author David Turanski
3637
* @author Artem Bilan
38+
*
3739
* @since 4.2
3840
*/
3941
public class PojoCodec extends AbstractKryoCodec {
@@ -99,7 +101,7 @@ protected <T> T doDecode(Kryo kryo, Input input, Class<T> type) {
99101

100102
@Override
101103
protected void configureKryoInstance(Kryo kryo) {
102-
kryo.setInstantiatorStrategy(new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
104+
kryo.setInstantiatorStrategy(new DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
103105
if (this.kryoRegistrar != null) {
104106
this.kryoRegistrar.registerTypes(kryo);
105107
}

0 commit comments

Comments
 (0)