Skip to content

Commit 18f1b53

Browse files
committed
Comments.
1 parent d33b987 commit 18f1b53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/org/jenkinsci/plugins/workflow/log/DelayBufferedOutputStream.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ private static final class Flush implements Runnable {
116116

117117
}
118118

119-
//
120119
/**
121120
* Flushes streams prior to garbage collection.
121+
* ({@link BufferedOutputStream} does not do this automatically.)
122122
* TODO Java 9+ could use java.util.Cleaner
123123
*/
124124
private static final class FlushRef extends PhantomReference<DelayBufferedOutputStream> {
@@ -134,7 +134,6 @@ private static final class FlushRef extends PhantomReference<DelayBufferedOutput
134134
}
135135
LOGGER.log(Level.FINE, "cleaning up phantom {0}", ref.out);
136136
try {
137-
// Odd that this is not the default behavior for BufferedOutputStream.
138137
ref.out.flush();
139138
} catch (IOException x) {
140139
LOGGER.log(Level.WARNING, null, x);

src/test/java/org/jenkinsci/plugins/workflow/log/LogStorageTestBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ private static final class RemotePrint extends MasterToSlaveCallable<Void, Excep
189189
return null;
190190
}
191191
}
192+
/** Checking behavior of {@link DelayBufferedOutputStream} garbage collection. */
192193
private static final class GC extends MasterToSlaveCallable<Void, Exception> {
193194
@Override public Void call() throws Exception {
194195
System.gc();

0 commit comments

Comments
 (0)