You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/07/02 19:36:22 UTC
[commons-lang] branch master updated: Fix Javadoc @since tags
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 5b6030595 Fix Javadoc @since tags
5b6030595 is described below
commit 5b6030595205f5f843549f1f12a0e1037bf4a50f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 2 15:36:17 2023 -0400
Fix Javadoc @since tags
Sort members
---
.../commons/lang3/exception/ExceptionUtils.java | 4 +-
.../lang3/exception/ExceptionUtilsTest.java | 82 +++++++++++-----------
2 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
index 26ffed3bd..6f320a27d 100644
--- a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
+++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
@@ -978,7 +978,7 @@ public class ExceptionUtils {
* @param throwable
* The throwable to check.
* @return True if the given Throwable is a checked exception.
- * @since 3.13
+ * @since 3.13.0
*/
public static boolean isChecked(final Throwable throwable) {
return throwable != null && !(throwable instanceof Error) && !(throwable instanceof RuntimeException);
@@ -990,7 +990,7 @@ public class ExceptionUtils {
* @param throwable
* The throwable to check.
* @return True if the given Throwable is an unchecked exception.
- * @since 3.13
+ * @since 3.13.0
*/
public static boolean isUnchecked(final Throwable throwable) {
return !isChecked(throwable);
diff --git a/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java b/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java
index bcb2762ee..e8a4652f0 100644
--- a/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java
@@ -123,19 +123,19 @@ public class ExceptionUtilsTest extends AbstractLangTest {
}
}
- private NestableException nested;
-
-
- private Throwable withCause;
+ private ExceptionWithCause cyclicCause;
- private Throwable withoutCause;
private Throwable jdkNoCause;
- private ExceptionWithCause cyclicCause;
+ private NestableException nested;
private Throwable notVisibleException;
+ private Throwable withCause;
+
+ private Throwable withoutCause;
+
private Throwable createExceptionWithCause() {
try {
try {
@@ -610,6 +610,41 @@ public class ExceptionUtilsTest extends AbstractLangTest {
assertEquals(0, ExceptionUtils.indexOfType(withCause, Throwable.class, 0));
}
+ @Test
+ public void testIsChecked_checked() {
+ assertTrue(ExceptionUtils.isChecked(new IOException()));
+ }
+
+ @Test
+ public void testIsChecked_error() {
+ assertFalse(ExceptionUtils.isChecked(new StackOverflowError()));
+ }
+
+ @Test
+ public void testIsChecked_null() {
+ assertFalse(ExceptionUtils.isChecked(null));
+ }
+
+ @Test
+ public void testIsChecked_unchecked() {
+ assertFalse(ExceptionUtils.isChecked(new IllegalArgumentException()));
+ }
+
+ @Test
+ public void testIsUnchecked_checked() {
+ assertFalse(ExceptionUtils.isUnchecked(new IOException()));
+ }
+
+ @Test
+ public void testIsUnchecked_error() {
+ assertTrue(ExceptionUtils.isUnchecked(new StackOverflowError()));
+ }
+
+ @Test
+ public void testIsUnchecked_unchecked() {
+ assertTrue(ExceptionUtils.isUnchecked(new IllegalArgumentException()));
+ }
+
@Test
public void testPrintRootCauseStackTrace_Throwable() {
ExceptionUtils.printRootCauseStackTrace(null);
@@ -850,39 +885,4 @@ public class ExceptionUtilsTest extends AbstractLangTest {
final Throwable t = assertThrows(Throwable.class, () -> ExceptionUtils.wrapAndThrow(new TestThrowable()));
assertTrue(ExceptionUtils.hasCause(t, TestThrowable.class));
}
-
- @Test
- public void testIsChecked_null() {
- assertFalse(ExceptionUtils.isChecked(null));
- }
-
- @Test
- public void testIsChecked_unchecked() {
- assertFalse(ExceptionUtils.isChecked(new IllegalArgumentException()));
- }
-
- @Test
- public void testIsChecked_checked() {
- assertTrue(ExceptionUtils.isChecked(new IOException()));
- }
-
- @Test
- public void testIsChecked_error() {
- assertFalse(ExceptionUtils.isChecked(new StackOverflowError()));
- }
-
- @Test
- public void testIsUnchecked_unchecked() {
- assertTrue(ExceptionUtils.isUnchecked(new IllegalArgumentException()));
- }
-
- @Test
- public void testIsUnchecked_checked() {
- assertFalse(ExceptionUtils.isUnchecked(new IOException()));
- }
-
- @Test
- public void testIsUnchecked_error() {
- assertTrue(ExceptionUtils.isUnchecked(new StackOverflowError()));
- }
}