diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java index e17a4e52e6..d62fc5d83b 100644 --- a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java +++ b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java @@ -423,9 +423,6 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry { if (editor == null) { // Find editor for superclass or interface. for (Map.Entry, PropertyEditor> entry : this.customEditors.entrySet()) { - if (editor != null) { - break; - } Class key = entry.getKey(); if (key.isAssignableFrom(requiredType)) { editor = entry.getValue(); @@ -435,6 +432,9 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry { this.customEditorCache = new HashMap<>(); } this.customEditorCache.put(requiredType, editor); + if (editor != null) { + break; + } } } }