[ 
https://issues.apache.org/jira/browse/WICKET-1389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602430#action_12602430
 ] 

Frank Bille Jensen commented on WICKET-1389:
--------------------------------------------

It would seem that the fix would indeed just be this. We don't need to worry 
about that there were a specific order before (were not using linkedhashmap) so 
nobody should have depended on that the order would be consistent.

BUT.

Just as we will now have tests fails when I commit this patch so does our 
users. So should this really go in both 1.4 AND 1.3 or 1.4 only?


Index: src/main/java/org/apache/wicket/util/value/ValueMap.java
===================================================================
--- src/main/java/org/apache/wicket/util/value/ValueMap.java    (revision 
663010)
+++ src/main/java/org/apache/wicket/util/value/ValueMap.java    (working copy)
@@ -20,9 +20,9 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.TreeMap;
 
 import org.apache.wicket.util.parse.metapattern.MetaPattern;
 import 
org.apache.wicket.util.parse.metapattern.parsers.VariableAssignmentParser;
@@ -58,7 +58,7 @@
  * @author Doug Donohoe
  * @since 1.2.6
  */
-public class ValueMap extends HashMap<String, Object> implements IValueMap
+public class ValueMap extends TreeMap<String, Object> implements IValueMap
 {
        /** an empty <code>ValueMap</code>. */
        public static final ValueMap EMPTY_MAP;

> Tests fail due to different order of attributes (under Java 6)
> --------------------------------------------------------------
>
>                 Key: WICKET-1389
>                 URL: https://issues.apache.org/jira/browse/WICKET-1389
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>         Environment: JDK 1.6.0_04
>            Reporter: Henrik Lundahl
>            Assignee: Frank Bille Jensen
>            Priority: Minor
>             Fix For: 1.4-M3
>
>
> When building wicket-1.3-SNAPSHOT using JDK 1.6.0_04 I get some test failures 
> with messages all similar to this:
> < <style type="text/css" id="org-apache-wicket-ajax-MockComponent1-0">
> ---
> > <style id="org-apache-wicket-ajax-MockComponent1-0" type="text/css">
> It seems like the element attributes have come in the "wrong" order (compared 
> to the test case).
> Since making the tests attribute order independent would probably be 
> difficult, I suggest instead that the code is changed to guarantee that the 
> attributes always come in the same order (TreeMap instead of HashMap?).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to