import java.util.Date;
import java.util.Enumeration;
import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
import java.util.Properties;
+import java.util.Set;
import java.util.StringTokenizer;
+import java.util.TreeMap;
import java.util.TreeSet;
import org.apache.log4j.ConsoleAppender;
/** Jalview Properties */
public static Properties applicationProperties = new Properties()
{
- // override results in properties output in alphabetical order
+ // override so properties are output in alphabetical order (Java 8)
@Override
public synchronized Enumeration<Object> keys()
{
return Collections.enumeration(new TreeSet<>(super.keySet()));
}
+
+ // override so properties are output in alphabetical order (Java 11)
+ @Override
+ public Set<Entry<Object, Object>> entrySet()
+ {
+ Map<Object, Object> copy = new TreeMap<>();
+ for (Object key : this.keySet())
+ {
+ copy.put(key, this.get(key));
+ }
+ return copy.entrySet();
+ }
};
/** Default file is ~/.jalview_properties */