From 98689c2660158e3aaa308041f008b9172a1f0cb2 Mon Sep 17 00:00:00 2001 From: Matthias Stock Date: Wed, 18 Dec 2019 22:40:43 +0100 Subject: [PATCH] Resolve JavaType only once for whitelisted class --- .../security/jackson2/SecurityJackson2Modules.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java index b2492b23485..f42d4549fd4 100644 --- a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java +++ b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2019 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. @@ -225,7 +225,7 @@ public JavaType typeFromId(DatabindContext context, String id) throws IOExceptio JavaType result = delegate.typeFromId(context, id); String className = result.getRawClass().getName(); if (isWhitelisted(className)) { - return delegate.typeFromId(context, id); + return result; } boolean isExplicitMixin = config.findMixInClassFor(result.getRawClass()) != null; if (isExplicitMixin) {