Commit 570fc5ff by s_guodong

update

parent 99684a63
...@@ -119,10 +119,12 @@ public class ValidatorUtil { ...@@ -119,10 +119,12 @@ public class ValidatorUtil {
int index = -1; int index = -1;
if (type.isAssignableFrom(String.class)) { if (type.isAssignableFrom(String.class)) {
String[] valueList = annotation.strValue(); String[] valueList = annotation.strValue();
Arrays.sort(valueList);
index = Arrays.binarySearch(valueList, o); index = Arrays.binarySearch(valueList, o);
} else if (type.isAssignableFrom(Integer.TYPE) || type.isAssignableFrom(Integer.class)) { } else if (type.isAssignableFrom(Integer.TYPE) || type.isAssignableFrom(Integer.class)) {
Integer v = (Integer) o; Integer v = (Integer) o;
int[] valueList = annotation.value(); int[] valueList = annotation.value();
Arrays.sort(valueList);
index = Arrays.binarySearch(valueList, v); index = Arrays.binarySearch(valueList, v);
} }
if (index < 0) { if (index < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment