2828 */
2929public class ThrowOnFlushAndCloseOutputStream extends ProxyOutputStream {
3030
31- private boolean yellOnFlush ;
32- private boolean yellOnClose ;
31+ private boolean throwOnFlush ;
32+ private boolean throwOnClose ;
3333
3434 /**
3535 * @param proxy OutputStream to delegate to.
36- * @param yellOnFlush True if flush() is forbidden
37- * @param yellOnClose True if close() is forbidden
36+ * @param throwOnFlush True if flush() is forbidden
37+ * @param throwOnClose True if close() is forbidden
3838 */
39- public ThrowOnFlushAndCloseOutputStream (final OutputStream proxy , final boolean yellOnFlush , final boolean yellOnClose ) {
39+ public ThrowOnFlushAndCloseOutputStream (final OutputStream proxy , final boolean throwOnFlush ,
40+ final boolean throwOnClose ) {
4041 super (proxy );
41- this .yellOnFlush = yellOnFlush ;
42- this .yellOnClose = yellOnClose ;
42+ this .throwOnFlush = throwOnFlush ;
43+ this .throwOnClose = throwOnClose ;
4344 }
4445
4546 /** @see java.io.OutputStream#flush() */
4647 @ Override
4748 public void flush () throws IOException {
48- if (yellOnFlush ) {
49+ if (throwOnFlush ) {
4950 fail (getClass ().getSimpleName () + ".flush() called." );
5051 }
5152 super .flush ();
@@ -54,15 +55,15 @@ public void flush() throws IOException {
5455 /** @see java.io.OutputStream#close() */
5556 @ Override
5657 public void close () throws IOException {
57- if (yellOnClose ) {
58+ if (throwOnClose ) {
5859 fail (getClass ().getSimpleName () + ".close() called." );
5960 }
6061 super .close ();
6162 }
6263
6364 public void off () {
64- yellOnFlush = false ;
65- yellOnClose = false ;
65+ throwOnFlush = false ;
66+ throwOnClose = false ;
6667 }
6768
6869}
0 commit comments