summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-09-08 14:32:11 +0200
committerGitHub <noreply@github.com>2022-09-08 14:32:11 +0200
commitb3dab34d3a9538b07293dc6079aa31c3de921f81 (patch)
treed93589547eaf2b9972cb7b4b3892210e6078cff5 /container-core
parent873a2e9eaec56c23310944b873938472c0884444 (diff)
parent1a2361bed219116c7dc1f7b78c1ca79485667f0a (diff)
Merge pull request #23976 from vespa-engine/jonmv/catch-right-exception
ClassCastException will be wrapped in an IllegalArgumentException
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/processing/request/CloneHelper.java5
1 files changed, 4 insertions, 1 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 64a356fbf2a..69ee284a3df 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
@@ -97,7 +97,10 @@ public class CloneHelper {
return ((HashSet<?>) object).clone();
try {
return cloneByReflection(object);
- } catch (ClassCastException e) {
+ } catch (IllegalArgumentException e) {
+ if ( ! (e.getCause() instanceof 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.