1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -94,18 +94,18 @@ else if (boundValue == null) {
94
94
selected = collectionCompare (CollectionUtils .arrayToList (boundValue ), candidateValue , bindStatus );
95
95
}
96
96
else if (boundValue instanceof Collection ) {
97
- selected = collectionCompare ((Collection ) boundValue , candidateValue , bindStatus );
97
+ selected = collectionCompare ((Collection <?> ) boundValue , candidateValue , bindStatus );
98
98
}
99
99
else if (boundValue instanceof Map ) {
100
- selected = mapCompare ((Map ) boundValue , candidateValue , bindStatus );
100
+ selected = mapCompare ((Map <?, ?> ) boundValue , candidateValue , bindStatus );
101
101
}
102
102
if (!selected ) {
103
103
selected = exhaustiveCompare (boundValue , candidateValue , bindStatus .getEditor (), null );
104
104
}
105
105
return selected ;
106
106
}
107
107
108
- private static boolean collectionCompare (Collection boundCollection , Object candidateValue , BindStatus bindStatus ) {
108
+ private static boolean collectionCompare (Collection <?> boundCollection , Object candidateValue , BindStatus bindStatus ) {
109
109
try {
110
110
if (boundCollection .contains (candidateValue )) {
111
111
return true ;
@@ -117,7 +117,7 @@ private static boolean collectionCompare(Collection boundCollection, Object cand
117
117
return exhaustiveCollectionCompare (boundCollection , candidateValue , bindStatus );
118
118
}
119
119
120
- private static boolean mapCompare (Map boundMap , Object candidateValue , BindStatus bindStatus ) {
120
+ private static boolean mapCompare (Map <?, ?> boundMap , Object candidateValue , BindStatus bindStatus ) {
121
121
try {
122
122
if (boundMap .containsKey (candidateValue )) {
123
123
return true ;
@@ -130,7 +130,7 @@ private static boolean mapCompare(Map boundMap, Object candidateValue, BindStatu
130
130
}
131
131
132
132
private static boolean exhaustiveCollectionCompare (
133
- Collection collection , Object candidateValue , BindStatus bindStatus ) {
133
+ Collection <?> collection , Object candidateValue , BindStatus bindStatus ) {
134
134
135
135
Map <PropertyEditor , Object > convertedValueCache = new HashMap <PropertyEditor , Object >(1 );
136
136
PropertyEditor editor = null ;
@@ -164,8 +164,8 @@ private static boolean exhaustiveCompare(Object boundValue, Object candidate,
164
164
return true ;
165
165
}
166
166
}
167
- else if (boundValue .getClass ().isEnum ()) {
168
- Enum boundEnum = (Enum ) boundValue ;
167
+ else if (boundValue != null && boundValue .getClass ().isEnum ()) {
168
+ Enum <?> boundEnum = (Enum <?> ) boundValue ;
169
169
String enumCodeAsString = ObjectUtils .getDisplayString (boundEnum .name ());
170
170
if (enumCodeAsString .equals (candidateDisplayString )) {
171
171
return true ;
0 commit comments