Hi, I don't know the other code of the file upload, but would it be better to use a LinkedHashMap to ensure the order?
kind regards Tobias > Am 30.10.2015 um 14:48 schrieb Sven Meier <[email protected]>: > > Hi all, > > I had problems building Wicket 6.x due to a failure in > MultiFileUploadFieldTest: > It seems that depending on the JVM the uploaded files are in a different > order. > > How about sorting the upload by input name? > > diff --git > a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadField.java > > b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadField.java > index 450a42d..cc95ff9 100644 > --- > a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadField.java > +++ > b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadField.java > @@ -18,6 +18,7 @@ package org.apache.wicket.markup.html.form.upload; > > import java.util.ArrayList; > import java.util.Collection; > +import java.util.Collections; > import java.util.HashMap; > import java.util.List; > import java.util.Map; > @@ -273,6 +274,7 @@ public class MultiFileUploadField extends > FormComponentPanel<Collection<FileUplo > > if (names != null) > { > + Collections.sort(names); > inputArrayCache = names.toArray(new > String[names.size()]); > } > } > > This way the test will always work, and the upload is kept in the order the > user has added the files. > > WDYT? > > Sven
