Skip to content

Commit 97c6385

Browse files
committed
Allow PropertyEditor conversion as fallback for enums
Issue: SPR-16082 (cherry picked from commit ef6aef9)
1 parent 4cc8f4c commit 97c6385

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectedValueComparator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -162,7 +162,8 @@ private static boolean exhaustiveCompare(Object boundValue, Object candidate,
162162
else if (ObjectUtils.getDisplayString(boundValue).equals(candidateDisplayString)) {
163163
return true;
164164
}
165-
else if (editor != null && candidate instanceof String) {
165+
166+
if (editor != null && candidate instanceof String) {
166167
// Try PE-based comparison (PE should *not* be allowed to escape creating thread)
167168
String candidateAsString = (String) candidate;
168169
Object candidateAsValue;

0 commit comments

Comments
 (0)