Rename private ivar.
@@ -36,7 +36,7 @@ import org.apache.logging.log4j.core.util.Constants;
public class OutputStreamManager extends AbstractManager implements ByteBufferDestination {
protected final Layout<?> layout;
protected ByteBuffer byteBuffer;
- private volatile OutputStream os;
+ private volatile OutputStream outputStream;
private boolean skipFooter;
protected OutputStreamManager(final OutputStream os, final String streamName, final Layout<?> layout,
@@ -59,7 +59,7 @@ public class OutputStreamManager extends AbstractManager implements ByteBufferDe
protected OutputStreamManager(final OutputStream os, final String streamName, final Layout<?> layout,
final boolean writeHeader, final ByteBuffer byteBuffer) {
super(null, streamName);
- this.os = os;
+ this.outputStream = os;
this.layout = layout;
if (writeHeader && layout != null) {
final byte[] header = layout.getHeader();
@@ -88,7 +88,7 @@ public class OutputStreamManager extends AbstractManager implements ByteBufferDe
}
this.layout = layout;
this.byteBuffer = Objects.requireNonNull(byteBuffer, "byteBuffer");
- this.os = os;
+ this.outputStream = os;
if (writeHeader && layout != null) {
final byte[] header = layout.getHeader();
if (header != null) {
@@ -159,14 +159,14 @@ public class OutputStreamManager extends AbstractManager implements ByteBufferDe
}
public boolean hasOutputStream() {
- return os != null;
+ return outputStream != null;
}
protected OutputStream getOutputStream() throws IOException {
- if (os == null) {
- os = createOutputStream();
+ if (outputStream == null) {
+ outputStream = createOutputStream();
}
- return os;
+ return outputStream;
}
protected void setOutputStream(final OutputStream os) {
@@ -174,12 +174,12 @@ public class OutputStreamManager extends AbstractManager implements ByteBufferDe
if (header != null) {
try {
os.write(header, 0, header.length);
- this.os = os; // only update field if os.write() succeeded
+ this.outputStream = os; // only update field if os.write() succeeded
} catch (final IOException ioe) {
logError("Unable to write header", ioe);
}
} else {
- this.os = os;
+ this.outputStream = os;
}
}
@@ -270,7 +270,7 @@ public class OutputStreamManager extends AbstractManager implements ByteBufferDe
* @since 2.6
*/
protected synchronized void flushDestination() {
- final OutputStream stream = os; // access volatile field only once per method
+ final OutputStream stream = outputStream; // access volatile field only once per method
if (stream != null) {
try {
stream.flush();
@@ -306,7 +306,7 @@ public class OutputStreamManager extends AbstractManager implements ByteBufferDe
protected synchronized boolean closeOutputStream() {
flush();
- final OutputStream stream = os; // access volatile field only once per method
+ final OutputStream stream = outputStream; // access volatile field only once per method
if (stream == null || stream == System.out || stream == System.err) {
return true;
}
