summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-10-25 21:12:02 +0200
committerjonmv <venstad@gmail.com>2022-10-25 21:12:02 +0200
commiteacaf2241d1319b69c7105b2d431e1cc160c4699 (patch)
treeed25b83c4d3614f79f561881c5b3d7014f3d8cea /container-core
parent1e907223e59bc18ffd85e401f962da598e07a665 (diff)
Remove now redundant try-catch
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/processing/request/CloneHelper.java16
1 files changed, 2 insertions, 14 deletions
diff --git a/container-core/src/main/java/com/yahoo/processing/request/CloneHelper.java b/container-core/src/main/java/com/yahoo/processing/request/CloneHelper.java
index 4ee8df0c249..d758aff0501 100644
--- a/container-core/src/main/java/com/yahoo/processing/request/CloneHelper.java
+++ b/container-core/src/main/java/com/yahoo/processing/request/CloneHelper.java
@@ -96,20 +96,8 @@ public class CloneHelper {
return ((HashMap<?, ?>) object).clone();
else if (object instanceof HashSet)
return ((HashSet<?>) object).clone();
- try {
- return cloneByReflection(object);
- } catch (IllegalArgumentException e) {
- if ( ! ( e.getCause() instanceof ClassCastException
- || Objects.requireNonNullElse(e.getMessage(), "").startsWith("java.lang.ClassCastException")))
- throw e;
-
- // When changing bundles you might end up having cached the old method pointing to old bundle,
- // That might then lead to a class cast exception when invoking the wrong clone method.
- // So we will give dropping the cache a try, and retry the clone.
- cloneMethodCache.clear();
- return cloneByReflection(object);
- }
-
+
+ return cloneByReflection(object);
}
private Object cloneByReflection(Object object) {