1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-11-11 20:05:03 -05:00

Sort properties file

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@960 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-03-19 10:28:35 +00:00
parent 7b78a9a1d6
commit 07768b1a78

View File

@ -20,7 +20,7 @@ package davmail;
import davmail.ui.tray.DavGatewayTray; import davmail.ui.tray.DavGatewayTray;
import java.util.Properties; import java.util.*;
import java.io.*; import java.io.*;
import org.apache.log4j.*; import org.apache.log4j.*;
@ -34,7 +34,28 @@ public final class Settings {
private Settings() { private Settings() {
} }
private static final Properties SETTINGS = new Properties(); private static final Properties SETTINGS = new Properties() {
@Override
public synchronized Enumeration<Object> keys() {
Enumeration keysEnumeration = super.keys();
TreeSet<String> sortedKeySet = new TreeSet<String>();
while (keysEnumeration.hasMoreElements()) {
sortedKeySet.add((String) keysEnumeration.nextElement());
}
final Iterator<String> sortedKeysIterator = sortedKeySet.iterator();
return new Enumeration<Object>() {
public boolean hasMoreElements() {
return sortedKeysIterator.hasNext();
}
public Object nextElement() {
return sortedKeysIterator.next();
}
};
}
};
private static String configFilePath; private static String configFilePath;
private static boolean isFirstStart; private static boolean isFirstStart;