Remove usage of obsolete NestedIOException

Related to https://github.com/spring-projects/spring-framework/issues/28198

Replaces its usage with the standard `IOException`
which has supported a root cause since Java 6.
This commit is contained in:
Artem Bilan
2022-03-18 17:00:55 -04:00
parent c1d29ab385
commit 7f501fabcb
2 changed files with 24 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@ import java.util.Set;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.core.ConfigurableObjectInputStream;
import org.springframework.core.NestedIOException;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.serializer.DefaultDeserializer;
import org.springframework.core.serializer.Deserializer;
@@ -117,7 +116,7 @@ public class AllowListDeserializingConverter implements Converter<byte[], Object
}
/**
* Add package/class patterns to the allow list.
* Add package/class patterns to the allowed list.
* @param patterns the patterns to add.
* @see #setAllowedPatterns(String...)
*/
@@ -160,7 +159,7 @@ public class AllowListDeserializingConverter implements Converter<byte[], Object
return objectInputStream.readObject();
}
catch (ClassNotFoundException ex) {
throw new NestedIOException("Failed to deserialize object type", ex);
throw new IOException("Failed to deserialize object type", ex);
}
}