FindBugs™ 1.3.9

edu.umd.cs.findbugs.config
Class SortedProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by edu.umd.cs.findbugs.config.SortedProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public final class SortedProperties
extends java.util.Properties

Author:
pugh
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
SortedProperties()
           
 
Method Summary
 java.util.Enumeration<java.lang.Object> keys()
          Overriden to be able to write properties sorted by keys to the disk
static java.util.Enumeration<?> sortKeys(java.util.Set<java.lang.String> keySet)
          To be compatible with version control systems, we need to sort properties before storing them to disk.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortedProperties

public SortedProperties()
Method Detail

keys

public java.util.Enumeration<java.lang.Object> keys()
Overriden to be able to write properties sorted by keys to the disk

Overrides:
keys in class java.util.Hashtable<java.lang.Object,java.lang.Object>
See Also:
Hashtable.keys()

sortKeys

public static java.util.Enumeration<?> sortKeys(java.util.Set<java.lang.String> keySet)
To be compatible with version control systems, we need to sort properties before storing them to disk. Otherwise each change may lead to problems by diff against previous version - because Property entries are randomly distributed (it's a map).

Parameters:
keySet - non null set instance to sort
Returns:
non null list wich contains all given keys, sorted lexicographically. The list may be empty if given set was empty

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.