mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 07:26:31 +00:00
docs: update mute idiom
This commit is contained in:
@@ -26,10 +26,12 @@ package com.iluwatar.mute;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* A utility class that allows you to utilize mute idiom.
|
||||
*/
|
||||
@Slf4j
|
||||
public final class Mute {
|
||||
|
||||
// The constructor is never meant to be called.
|
||||
@@ -40,7 +42,7 @@ public final class Mute {
|
||||
* Executes the <code>runnable</code> and throws the exception occurred within a {@link
|
||||
* AssertionError}. This method should be utilized to mute the operations that are guaranteed not
|
||||
* to throw an exception. For instance {@link ByteArrayOutputStream#write(byte[])} declares in
|
||||
* it's signature that it can throw an {@link IOException}, but in reality it cannot. This is
|
||||
* its signature that it can throw an {@link IOException}, but in reality it cannot. This is
|
||||
* because the bulk write method is not overridden in {@link ByteArrayOutputStream}.
|
||||
*
|
||||
* @param runnable a runnable that should never throw an exception on execution.
|
||||
|
||||
Reference in New Issue
Block a user