incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1001768 - /incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/constraints/dynamic/AbstractValuesConstraintAppender.java
Date Mon, 27 Sep 2010 14:57:15 GMT
Author: mbenson
Date: Mon Sep 27 14:57:15 2010
New Revision: 1001768

URL: http://svn.apache.org/viewvc?rev=1001768&view=rev
Log:
preserve order from *values constraints as far as possible

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/constraints/dynamic/AbstractValuesConstraintAppender.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/constraints/dynamic/AbstractValuesConstraintAppender.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/constraints/dynamic/AbstractValuesConstraintAppender.java?rev=1001768&r1=1001767&r2=1001768&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/constraints/dynamic/AbstractValuesConstraintAppender.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/constraints/dynamic/AbstractValuesConstraintAppender.java
Mon Sep 27 14:57:15 2010
@@ -25,6 +25,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -89,9 +90,9 @@ public abstract class AbstractValuesCons
     }
 
     private class CumulativeValues {
-        final Set<V> values = new HashSet<V>();
+        final Set<V> values = new LinkedHashSet<V>();
         final Set<Class<? extends Payload>> payload = new HashSet<Class<?
extends Payload>>();
-        final Set<String> message = new HashSet<String>();
+        final Set<String> message = new LinkedHashSet<String>();
         final Strategy strategy;
 
         /**
@@ -283,8 +284,8 @@ public abstract class AbstractValuesCons
         CumulativeValues values = valuesMap.remove(group);
         HashSet<Class<?>> groups = new HashSet<Class<?>>();
         groups.add(group.getGroup());
-        HashSet<Class<? extends Payload>> payloads = new HashSet<Class<?
extends Payload>>(values.payload);
-        HashSet<String> messages = new HashSet<String>(values.message);
+        Set<Class<? extends Payload>> payloads = new LinkedHashSet<Class<?
extends Payload>>(values.payload);
+        Set<String> messages = new LinkedHashSet<String>(values.message);
         if (!values.values.isEmpty()) {
             // merge groups with same values and strategy:
             for (Iterator<Map.Entry<Group, CumulativeValues>> iter = valuesMap.entrySet().iterator();
iter.hasNext();) {



Mime
View raw message