cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1045120 - /cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerPreferences.java
Date Mon, 13 Dec 2010 14:01:07 GMT
Author: oltka
Date: Mon Dec 13 14:01:07 2010
New Revision: 1045120

URL: http://svn.apache.org/viewvc?rev=1045120&view=rev
Log:
CAY-1517 CayenneModeler - recent projects ordering is random

Modified:
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerPreferences.java

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerPreferences.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerPreferences.java?rev=1045120&r1=1045119&r2=1045120&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerPreferences.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerPreferences.java
Mon Dec 13 14:01:07 2010
@@ -20,6 +20,7 @@
 package org.apache.cayenne.modeler;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.prefs.BackingStoreException;
 import java.util.prefs.PreferenceChangeEvent;
@@ -88,13 +89,21 @@ public class ModelerPreferences implemen
         try {
             keys = filesPrefs.keys();
         }
+        
         catch (BackingStoreException e) {
             logObj.warn("Error reading preferences file.", e);
         }
         if (keys != null) {
             int len = keys.length;
+            
+            ArrayList<Integer> keysInteger = new ArrayList<Integer>();
             for (int i = 0; i < len; i++) {
-                arrayLastProjFiles.add(filesPrefs.get(keys[i], ""));
+                keysInteger.add(new Integer(i));
+            }
+            Collections.sort(keysInteger);
+            
+            for (int i = 0; i < len; i++) {
+                arrayLastProjFiles.add(filesPrefs.get(keysInteger.get(i).toString(), ""));
             }
         }
         return arrayLastProjFiles;



Mime
View raw message