Skip to content

Commit b922165

Browse files
committed
Declare ClassLoader for DeserializingConverter constructor as nullable
Closes gh-30670
1 parent c30f6aa commit b922165

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

spring-core/src/main/java/org/springframework/core/serializer/DefaultDeserializer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -50,6 +50,7 @@ public DefaultDeserializer() {
5050
/**
5151
* Create a {@code DefaultDeserializer} for using an {@link ObjectInputStream}
5252
* with the given {@code ClassLoader}.
53+
* @param classLoader the ClassLoader to use
5354
* @since 4.2.1
5455
* @see ConfigurableObjectInputStream#ConfigurableObjectInputStream(InputStream, ClassLoader)
5556
*/

spring-core/src/main/java/org/springframework/core/serializer/support/DeserializingConverter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -21,6 +21,7 @@
2121
import org.springframework.core.convert.converter.Converter;
2222
import org.springframework.core.serializer.DefaultDeserializer;
2323
import org.springframework.core.serializer.Deserializer;
24+
import org.springframework.lang.Nullable;
2425
import org.springframework.util.Assert;
2526

2627
/**
@@ -50,10 +51,11 @@ public DeserializingConverter() {
5051
/**
5152
* Create a {@code DeserializingConverter} for using an {@link java.io.ObjectInputStream}
5253
* with the given {@code ClassLoader}.
54+
* @param classLoader the ClassLoader to use
5355
* @since 4.2.1
5456
* @see DefaultDeserializer#DefaultDeserializer(ClassLoader)
5557
*/
56-
public DeserializingConverter(ClassLoader classLoader) {
58+
public DeserializingConverter(@Nullable ClassLoader classLoader) {
5759
this.deserializer = new DefaultDeserializer(classLoader);
5860
}
5961

0 commit comments

Comments
 (0)