diff options
author | jonmv <venstad@gmail.com> | 2022-09-08 12:07:23 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-09-08 12:07:23 +0200 |
commit | 1a2361bed219116c7dc1f7b78c1ca79485667f0a (patch) | |
tree | 5117b3dd9b0ce8cc15bee760d698e7f7654ceeb9 /container-core/src/main/java/com/yahoo/processing | |
parent | 6a4629eef5284bbf66e400b8a29692bfaa2b9d96 (diff) |
ClassCastException will be wrapped in an IllegalArgumentException
Diffstat (limited to 'container-core/src/main/java/com/yahoo/processing')
-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. |