Skip to content

Commit

Permalink
[#286] Patch that even if you have many arguments with same length, t…
Browse files Browse the repository at this point in the history
…hey will be add in the right order.
  • Loading branch information
opensource21 authored and erwan committed Oct 15, 2010
1 parent 5d49a46 commit 1531d15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions framework/src/play/data/validation/Check.java
Expand Up @@ -13,8 +13,8 @@ public Check() {
public void setMessage(String message, String... vars) {
checkWithCheck.setMessage(message);
checkWithCheck.variables.clear();
for (String variable : vars) {
checkWithCheck.variables.put("var" + (variable.length()), variable);
for (int i = 0; i < vars.length; i++) {
checkWithCheck.variables.put("var" + i, vars[i]);
}
checkWithCheck.setVariables();
}
Expand Down
5 changes: 3 additions & 2 deletions framework/src/play/data/validation/CheckWithCheck.java
@@ -1,8 +1,9 @@
package play.data.validation;

import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

import net.sf.oval.Validator;
import net.sf.oval.configuration.annotation.AbstractAnnotationCheck;
import net.sf.oval.context.OValContext;
Expand All @@ -13,7 +14,7 @@ public class CheckWithCheck extends AbstractAnnotationCheck<CheckWith> {

final static String mes = "validation.invalid";

Map<String, String> variables = new HashMap<String, String>();
Map<String, String> variables = new TreeMap<String, String>();
Check check;

@Override
Expand Down

0 comments on commit 1531d15

Please sign in to comment.