From 211532f08db10989e0a12248a02913940cb5df77 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 27 Aug 2021 23:15:23 -0700 Subject: [PATCH] Exclude CustomNumberEditor and CustomBooleanEditor Add `CustomNumberEditor` and `CustomBooleanEditor` to the editor exclusions sine the regular `ConversionService` should be able to handle them. Closes gh-27829 --- .../boot/context/properties/bind/BindConverter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java index 0072cdae88..a38335401f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java @@ -30,6 +30,8 @@ import java.util.function.Consumer; import org.springframework.beans.BeanUtils; import org.springframework.beans.PropertyEditorRegistry; import org.springframework.beans.SimpleTypeConverter; +import org.springframework.beans.propertyeditors.CustomBooleanEditor; +import org.springframework.beans.propertyeditors.CustomNumberEditor; import org.springframework.beans.propertyeditors.FileEditor; import org.springframework.boot.convert.ApplicationConversionService; import org.springframework.core.ResolvableType; @@ -175,7 +177,9 @@ final class BindConverter { private static final Set> EXCLUDED_EDITORS; static { Set> excluded = new HashSet<>(); - excluded.add(FileEditor.class); // gh-12163 + excluded.add(CustomNumberEditor.class); + excluded.add(CustomBooleanEditor.class); + excluded.add(FileEditor.class); EXCLUDED_EDITORS = Collections.unmodifiableSet(excluded); }