Skip to content

Commit

Permalink
ELY-1096: Remove unnecesary volatile modifier for currentSize variabl…
Browse files Browse the repository at this point in the history
…e in Rotating File Audit log
  • Loading branch information
Yeray Borges committed May 5, 2017
1 parent 787c84f commit 4912377
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/main/java/org/wildfly/security/audit/FileAuditEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,26 @@ private void safeClose(Closeable c) {
}
}

/**
* Writes <code>bytes.length</code> bytes from the specified byte array
* to the underlying output stream managed by this class.
* The general contract for <code>write(bytes)</code> is that it must be
* invoked from a synchronization block surrounding one log message processing.
*
* @param bytes the data.
* @throws IOException if an I/O error occurs.
*/
protected void write(byte[] bytes) throws IOException {
outputStream.write(bytes);
}

/**
* The general contract for <code>preWrite(date)</code> is that any method override
* must ensure thread safety invoking this method from a synchronization block
* surrounding one log message processing.
*
* @param date
*/
protected void preWrite(Date date) {
// NO-OP by default
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class RotatingFileAuditEndpoint extends FileAuditEndpoint {

private String nextSuffix;
private long nextRollover = Long.MAX_VALUE;
private volatile long currentSize = 0;
private long currentSize = 0;

RotatingFileAuditEndpoint(Builder builder) throws IOException {
super(builder);
Expand Down

0 comments on commit 4912377

Please sign in to comment.