diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-08 14:32:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-08 14:32:11 +0200 |
commit | b3dab34d3a9538b07293dc6079aa31c3de921f81 (patch) | |
tree | d93589547eaf2b9972cb7b4b3892210e6078cff5 /container-core | |
parent | 873a2e9eaec56c23310944b873938472c0884444 (diff) | |
parent | 1a2361bed219116c7dc1f7b78c1ca79485667f0a (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.java | 5 |
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. |