From 3862ce78f31c158446ef513be49320d543e31456 Mon Sep 17 00:00:00 2001 From: Haroon Khan Date: Tue, 14 Jun 2022 21:56:25 +0100 Subject: [PATCH] [JAVA-12620] Split core-java-exceptions module --- core-java-modules/core-java-exceptions-2/README.md | 2 ++ core-java-modules/core-java-exceptions-3/README.md | 7 ++++++- core-java-modules/core-java-exceptions-4/README.md | 7 ++++++- core-java-modules/core-java-exceptions-4/pom.xml | 6 ++++++ .../exception}/sneakythrows/SneakyThrowsExamples.java | 6 +++--- .../sneakythrows/SneakyThrowsExamplesUnitTest.java | 10 +++++----- core-java-modules/core-java-exceptions/README.md | 4 ++-- core-java-modules/core-java-exceptions/pom.xml | 6 ------ 8 files changed, 30 insertions(+), 18 deletions(-) rename core-java-modules/{core-java-exceptions/src/main/java/com/baeldung/exceptions => core-java-exceptions-4/src/main/java/com/baeldung/exception}/sneakythrows/SneakyThrowsExamples.java (90%) rename core-java-modules/{core-java-exceptions/src/test/java/com/baeldung/exceptions => core-java-exceptions-4/src/test/java/com/baeldung/exception}/sneakythrows/SneakyThrowsExamplesUnitTest.java (76%) diff --git a/core-java-modules/core-java-exceptions-2/README.md b/core-java-modules/core-java-exceptions-2/README.md index e6441c2c12..428ca16813 100644 --- a/core-java-modules/core-java-exceptions-2/README.md +++ b/core-java-modules/core-java-exceptions-2/README.md @@ -14,3 +14,5 @@ This module contains articles about core java exceptions - [How to Find an Exception’s Root Cause in Java](https://www.baeldung.com/java-exception-root-cause) - [Java IOException “Too many open files”](https://www.baeldung.com/java-too-many-open-files) - [When Does Java Throw the ExceptionInInitializerError?](https://www.baeldung.com/java-exceptionininitializererror) +- More articles: [[<-- prev]](../core-java-exceptions-1) [[next -->]](../core-java-exceptions-3) + diff --git a/core-java-modules/core-java-exceptions-3/README.md b/core-java-modules/core-java-exceptions-3/README.md index d269444ccb..5f46c337b8 100644 --- a/core-java-modules/core-java-exceptions-3/README.md +++ b/core-java-modules/core-java-exceptions-3/README.md @@ -1,5 +1,8 @@ -### Relevant Articles: +## Core Java Exceptions +This module contains articles about core java exceptions + +### Relevant Articles: - [NoSuchMethodError in Java](https://www.baeldung.com/java-nosuchmethod-error) - [IllegalArgumentException or NullPointerException for a Null Parameter?](https://www.baeldung.com/java-illegalargumentexception-or-nullpointerexception) - [IllegalMonitorStateException in Java](https://www.baeldung.com/java-illegalmonitorstateexception) @@ -10,3 +13,5 @@ - [NoSuchFieldError in Java](https://www.baeldung.com/java-nosuchfielderror) - [IllegalAccessError in Java](https://www.baeldung.com/java-illegalaccesserror) - [Working with (Unknown Source) Stack Traces in Java](https://www.baeldung.com/java-unknown-source-stack-trace) +- More articles: [[<-- prev]](../core-java-exceptions-2) [[next -->]](../core-java-exceptions-4) + diff --git a/core-java-modules/core-java-exceptions-4/README.md b/core-java-modules/core-java-exceptions-4/README.md index 7df8ef65b9..1ea95510e9 100644 --- a/core-java-modules/core-java-exceptions-4/README.md +++ b/core-java-modules/core-java-exceptions-4/README.md @@ -1,5 +1,10 @@ -### Relevant Articles: +## Core Java Exceptions +This module contains articles about core java exceptions + +### Relevant articles: - [Java ArrayIndexOutOfBoundsException](https://www.baeldung.com/java-arrayindexoutofboundsexception) - [Java Missing Return Statement](https://www.baeldung.com/java-missing-return-statement) - [Convert long to int Type in Java](https://www.baeldung.com/java-convert-long-to-int) +- [“Sneaky Throws” in Java](https://www.baeldung.com/java-sneaky-throws) +- [[<-- Prev]](../core-java-exceptions-3) \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions-4/pom.xml b/core-java-modules/core-java-exceptions-4/pom.xml index e9a2d05180..e691e1446d 100644 --- a/core-java-modules/core-java-exceptions-4/pom.xml +++ b/core-java-modules/core-java-exceptions-4/pom.xml @@ -22,6 +22,12 @@ ${h2.version} test + + org.projectlombok + lombok + ${lombok.version} + provided + diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsExamples.java b/core-java-modules/core-java-exceptions-4/src/main/java/com/baeldung/exception/sneakythrows/SneakyThrowsExamples.java similarity index 90% rename from core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsExamples.java rename to core-java-modules/core-java-exceptions-4/src/main/java/com/baeldung/exception/sneakythrows/SneakyThrowsExamples.java index 37f2e4ba9c..dc868c867b 100644 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsExamples.java +++ b/core-java-modules/core-java-exceptions-4/src/main/java/com/baeldung/exception/sneakythrows/SneakyThrowsExamples.java @@ -1,9 +1,9 @@ -package com.baeldung.exceptions.sneakythrows; - -import java.io.IOException; +package com.baeldung.exception.sneakythrows; import lombok.SneakyThrows; +import java.io.IOException; + public class SneakyThrowsExamples { public static void sneakyThrow(Throwable e) throws E { diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsExamplesUnitTest.java b/core-java-modules/core-java-exceptions-4/src/test/java/com/baeldung/exception/sneakythrows/SneakyThrowsExamplesUnitTest.java similarity index 76% rename from core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsExamplesUnitTest.java rename to core-java-modules/core-java-exceptions-4/src/test/java/com/baeldung/exception/sneakythrows/SneakyThrowsExamplesUnitTest.java index 8809bf78d9..3fe705d9d2 100644 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsExamplesUnitTest.java +++ b/core-java-modules/core-java-exceptions-4/src/test/java/com/baeldung/exception/sneakythrows/SneakyThrowsExamplesUnitTest.java @@ -1,12 +1,12 @@ -package com.baeldung.exceptions.sneakythrows; +package com.baeldung.exception.sneakythrows; -import static com.baeldung.exceptions.sneakythrows.SneakyThrowsExamples.throwSneakyIOException; -import static com.baeldung.exceptions.sneakythrows.SneakyThrowsExamples.throwSneakyIOExceptionUsingLombok; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import org.junit.Test; import java.io.IOException; -import org.junit.Test; +import static com.baeldung.exception.sneakythrows.SneakyThrowsExamples.throwSneakyIOException; +import static com.baeldung.exception.sneakythrows.SneakyThrowsExamples.throwSneakyIOExceptionUsingLombok; +import static org.assertj.core.api.Assertions.assertThatThrownBy; public class SneakyThrowsExamplesUnitTest { diff --git a/core-java-modules/core-java-exceptions/README.md b/core-java-modules/core-java-exceptions/README.md index b74ede51e8..1a8f3b3674 100644 --- a/core-java-modules/core-java-exceptions/README.md +++ b/core-java-modules/core-java-exceptions/README.md @@ -9,9 +9,9 @@ This module contains articles about core java exceptions - [Exception Handling in Java](https://www.baeldung.com/java-exceptions) - [Differences Between Final, Finally and Finalize in Java](https://www.baeldung.com/java-final-finally-finalize) - [Difference Between Throw and Throws in Java](https://www.baeldung.com/java-throw-throws) -- [“Sneaky Throws” in Java](https://www.baeldung.com/java-sneaky-throws) - [The StackOverflowError in Java](https://www.baeldung.com/java-stack-overflow-error) - [Checked and Unchecked Exceptions in Java](https://www.baeldung.com/java-checked-unchecked-exceptions) - [Common Java Exceptions](https://www.baeldung.com/java-common-exceptions) - [Will an Error Be Caught by Catch Block in Java?](https://www.baeldung.com/java-error-catch) -- [[Next -->]](/core-java-modules/core-java-exceptions-2) \ No newline at end of file +- [[Next -->]](../core-java-exceptions-2) +- \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/pom.xml b/core-java-modules/core-java-exceptions/pom.xml index f1f60120a5..866248b416 100644 --- a/core-java-modules/core-java-exceptions/pom.xml +++ b/core-java-modules/core-java-exceptions/pom.xml @@ -21,12 +21,6 @@ mail ${javax.mail.version} - - org.projectlombok - lombok - ${lombok.version} - provided - org.apache.commons commons-lang3