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/06 19:29:43 UTC
[commons-weaver] branch master updated: Throw a RuntimeException subclass instead of RuntimeException
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-weaver.git
The following commit(s) were added to refs/heads/master by this push:
new 21e3039 Throw a RuntimeException subclass instead of RuntimeException
21e3039 is described below
commit 21e30398b29be6e902d0c2cdf337626520dc474e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Jul 6 15:29:39 2023 -0400
Throw a RuntimeException subclass instead of RuntimeException
---
processor/src/main/java/org/apache/commons/weaver/Finder.java | 4 ++--
processor/src/main/java/org/apache/commons/weaver/utils/URLArray.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/processor/src/main/java/org/apache/commons/weaver/Finder.java b/processor/src/main/java/org/apache/commons/weaver/Finder.java
index cf0a608..77415d0 100644
--- a/processor/src/main/java/org/apache/commons/weaver/Finder.java
+++ b/processor/src/main/java/org/apache/commons/weaver/Finder.java
@@ -165,7 +165,7 @@ class Finder extends AnnotationFinder implements Scanner {
try {
enumType = Class.forName(Type.getType(desc).getClassName()).asSubclass(Enum.class);
} catch (final ClassNotFoundException e) {
- throw new RuntimeException(e);
+ throw new IllegalArgumentException(e);
}
@SuppressWarnings("unchecked")
final Enum<?> enumValue = Enum.valueOf(enumType, value);
@@ -703,7 +703,7 @@ class Finder extends AnnotationFinder implements Scanner {
try {
result = getArchive().loadClass(className);
} catch (final ClassNotFoundException e1) {
- throw new RuntimeException(e1);
+ throw new IllegalArgumentException(e1);
}
}
if (type.getSort() == Type.ARRAY) {
diff --git a/processor/src/main/java/org/apache/commons/weaver/utils/URLArray.java b/processor/src/main/java/org/apache/commons/weaver/utils/URLArray.java
index c6a4fb6..e3c40df 100644
--- a/processor/src/main/java/org/apache/commons/weaver/utils/URLArray.java
+++ b/processor/src/main/java/org/apache/commons/weaver/utils/URLArray.java
@@ -55,7 +55,7 @@ public final class URLArray {
return f.toURI().toURL();
} catch (final MalformedURLException e) {
// this shouldn't happen
- throw new RuntimeException(e);
+ throw new IllegalArgumentException(e);
}
}).toArray(URL[]::new);
}