public static Logger log;
/** Jalview Properties */
- public static Properties applicationProperties = new Properties()
- {
- // 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();
- }
- };
+ public static Properties applicationProperties = new Properties();
/** Default file is ~/.jalview_properties */
static String propertiesFile;
{
try
{
+ Properties orderedProperties = new Properties()
+ {
+ // 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();
+ }
+ };
+ orderedProperties.putAll(applicationProperties);
+
FileOutputStream out = new FileOutputStream(propertiesFile);
- applicationProperties.store(out, "---JalviewX Properties File---");
+ orderedProperties.store(out, "---JalviewX Properties File---");
out.close();
} catch (Exception ex)
{