Changeset 5281


Ignore:
Timestamp:
Aug 15, 2016, 1:58:38 AM (6 years ago)
Author:
Christian Schulte
Message:

o Merged changes up to 5280 from 'trunk' into branch 'jomc-tools-1.x'.

See #104

Location:
jomc-tools/branches/jomc-tools-1.x
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • jomc-tools/branches/jomc-tools-1.x

  • jomc-tools/branches/jomc-tools-1.x/jomc-tools

  • jomc-tools/branches/jomc-tools-1.x/jomc-tools/src/main/java/org/jomc/tools/SourceFileProcessor.java

    r5279 r5281  
    3737import java.io.IOException;
    3838import java.io.InputStreamReader;
     39import java.io.OutputStreamWriter;
    3940import java.io.Reader;
    4041import java.io.StringWriter;
     42import java.io.Writer;
    4143import java.nio.channels.FileLock;
    4244import java.text.MessageFormat;
     
    14171419
    14181420            FileOutputStream out = null;
     1421            Writer writer = null;
    14191422            FileLock fileLock = null;
    14201423            try
    14211424            {
    14221425                out = new FileOutputStream( file );
     1426                writer = new OutputStreamWriter( out, getOutputEncoding() );
    14231427                fileLock = out.getChannel().lock();
    14241428
    1425                 out.write( content.getBytes( getOutputEncoding() ) );
     1429                writer.write( content );
    14261430                out.getChannel().force( true );
    14271431
     
    14291433                fileLock = null;
    14301434
    1431                 out.close();
    1432                 out = null;
     1435                writer.close();
     1436                writer = null;
    14331437            }
    14341438            finally
    14351439            {
    1436                 this.releaseAndClose( fileLock, out );
     1440                this.releaseAndClose( fileLock, writer );
    14371441            }
    14381442        }
Note: See TracChangeset for help on using the changeset viewer.