Buggy code:
public class FormatPreservingProperties extends Properties { private static Localizer _loc = Localizer . forPackage ( FormatPreservingProperties . class ) ; private char defaultEntryDelimiter = ':' ; private boolean addWhitespaceAfterDelimiter = true ; private boolean allowDuplicates = false ; private boolean insertTimestamp = false ; private FormatPreservingProperties . PropertySource source ; private LinkedHashSet newKeys = new LinkedHashSet ( ) ; private HashSet modifiedKeys = new HashSet ( ) ; private transient boolean isNotDeserializing = true ; private transient boolean isLoading = false ; public FormatPreservingProperties ( ) { } public FormatPreservingProperties ( Properties defaults ) { } public void setDefaultEntryDelimiter ( char defaultEntryDelimiter ) { } public char getDefaultEntryDelimiter ( ) { } public void setAddWhitespaceAfterDelimiter ( boolean add ) { } public boolean getAddWhitespaceAfterDelimiter ( ) { } public void setInsertTimestamp ( boolean insertTimestamp ) { } public boolean getInsertTimestamp ( ) { } public void setAllowDuplicates ( boolean allowDuplicates ) { } public boolean getAllowDuplicates ( ) { } public String getProperty ( String key ) { } public String getProperty ( String key , String defaultValue ) { } public Object setProperty ( String key , String value ) { } public void putAll ( Map m ) { } public Object remove ( Object key ) { } public void clear ( ) { } public Object clone ( ) { } private void writeObject ( ObjectOutputStream out ) throws IOException { } private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } public Object put ( Object key , Object val ) { } public void load ( InputStream in ) throws IOException { } private void loadProperties ( InputStream in ) throws IOException { } private static int readEscape ( String source , int pos , StringBuffer value ) { } private static boolean isSpace ( char ch ) { } public void save ( OutputStream out , String header ) { } public void store ( OutputStream out , String header ) throws IOException { } private boolean writeProperty ( String key , PrintWriter writer , boolean needsNewline ) { } private static void formatValue ( String str , StringBuffer buf , boolean isKey ) { } public static class DuplicateKeyException extends RuntimeException { public DuplicateKeyException ( String key , Object firstVal , String secondVal ) { } } private class PropertyLine implements Serializable { private final StringBuffer line = new StringBuffer ( ) ; private String propertyKey ; private String propertyValue ; public PropertyLine ( String line ) { } public void append ( String newline ) { <START_BUG> line . append ( System . getProperty ( "line.separator" ) ) ; <END_BUG> line . append ( newline ) ; } public void setPropertyKey ( String propertyKey ) { } public String getPropertyKey ( ) { } public void setPropertyValue ( String propertyValue ) { } public String getPropertyValue ( ) { } public boolean write ( PrintWriter pw , Collection keys , boolean needsNewline ) { } } private class PropertyLineReader extends BufferedReader { public PropertyLineReader ( InputStream in , FormatPreservingProperties . PropertySource source ) throws IOException { } public FormatPreservingProperties . PropertyLine readPropertyLine ( ) throws IOException { } } private static class LineEndingStream extends FilterInputStream { private final FormatPreservingProperties . PropertySource source ; LineEndingStream ( InputStream in , FormatPreservingProperties . PropertySource source ) { } public int read ( ) throws IOException { } public int read ( byte [ ] b , int off , int len ) throws IOException { } } static class PropertySource extends LinkedList implements Serializable , Cloneable { private boolean endsInNewline = false ; } }

Fix:
line . append ( J2DoPrivHelper . getLineSeparator ( ) ) ;