Skip to content

Commit

Permalink
Update rationale behind the ExceptionSupressor utility
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-dejongh committed Sep 22, 2024
1 parent 714b044 commit c472525
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
Empty file added .github/workflows/publish.yml
Empty file.
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<sonar.projectKey>sddevelopment_coding-utils</sonar.projectKey>
<sonar.coverage.jacoco.xmlReportPaths>${jacoco.build.dir}/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
<sonar.coverage.exclusions>**/*.html</sonar.coverage.exclusions>
<sonar.cpd.exclusions>**/*.html</sonar.cpd.exclusions>
<jacoco.build.dir>${project.build.directory}/jacoco</jacoco.build.dir>

<java.version>21</java.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,21 @@
* <p>
* When using functional programming techniques in java 8+,
* a common issue is the inability to chain operations using method references if those
* called methods throw a checked exception. <br />
* called methods throw a checked exception.
* This class is meant to <strong>suppress these checked exceptions</strong->.
* <br /><br />
* It can also be used to write your exception handling in a more fluent way,
* and to facilitate designs based on using Unchecked Exceptions.
* </p>
*
* <h6>Example usage</h6>
*
* <h6>References</h6>
*
* @author <a href="https://github.com/stijn-dejongh" target="_blank">Stijn Dejongh</a>
* @version 1.0.0
* @created 01.11.20, Sunday
* @apiNote {@link ExceptionSuppressor} can also be used to write your exception handling in a
* more fluent way,
* and to facilitate designs based on throwing Unchecked {@link Exception}s from various
* architectural levels in your codebase.
* See <a href="https://howtodoinjava.com/java/exception-handling/checked-vs-unchecked-exceptions-in-java/"
* target="_blank"this article on the difference between checked and unchecked exceptions.</a>
* and the documentation of <a href="https://projectlombok.org/features/SneakyThrows"
* target="_blank">Lombok's @SneakyThrows</a> implementation.
* @since 1.0.0
*/
@Utility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@

/**
* <p>
* Interface for a Function that can throw an {@link Exception}
* An interface to generically represent {@link java.util.function.Function}s that possibly throw an Exception.
* To be used in combination with the {@link ExceptionSuppressor} class.
* </p>
*
* <h6>References</h6>
* {@link java.util.function.Function}
*
* @author <a href="https://github.com/stijn-dejongh" target="_blank">Stijn Dejongh</a>
* @version 1.0.0
* @created 01.11.20, Sunday
* @since 1.0.0
* @apiNote Not to be used outside the scope of generic {@link Exception} flow processing.
*
*/
@FunctionalInterface
interface FallibleFunction<T, R> {
Expand Down

0 comments on commit c472525

Please sign in to comment.