diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2022-10-25 17:41:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 17:41:57 +0200 |
commit | a033239b86242f7cbf793c5bbf678cca794a225c (patch) | |
tree | 202ce1743c95b77041a2a3f587d1c02bbfe47c65 /container-core | |
parent | f73ba9276acf8b1032d1c015c434bf544317fad1 (diff) | |
parent | 1b2baba3fe08b423c7263f4aef1980e5f92054b5 (diff) |
Merge pull request #24582 from vespa-engine/jonmv/compare-message-string
Fall back to comparing exception message
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/processing/request/CloneHelper.java | 4 |
1 files changed, 3 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 69ee284a3df..cf3ff7d3d66 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 @@ -8,6 +8,7 @@ import com.yahoo.lang.PublicCloneable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashSet; +import java.util.Objects; import java.util.logging.Logger; import java.util.LinkedList; import java.util.ArrayList; @@ -98,7 +99,8 @@ public class CloneHelper { try { return cloneByReflection(object); } catch (IllegalArgumentException e) { - if ( ! (e.getCause() instanceof ClassCastException)) + 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, |