diff options
author | 2017-11-22 15:38:23 +0100 | |
---|---|---|
committer | 2017-11-22 15:38:26 +0100 | |
commit | ca6abb7ac148362b74d29c062df80d0ad67e723f (patch) | |
tree | 859f34f4f929dd09a541b8d58f3ad3792a07bd89 /infra/translate-api/src | |
parent | 0827063002d7fc50b787f1e5f6bbbbdc09802787 (diff) |
Make fields of UpdateFailedException transient
Exceptions are Serializable.
Fields of Serializable class must be either Serializable or transient.
But DataObjects are not serializable, and there is really no reason to
serialize UpdateFailedException.
This patch excludes fields of the UpdateFailedException
from serialization process to fix Sonar warnings.
Change-Id: I1eb9408289241bb4fe6f712ed9208f8460eef317
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/translate-api/src')
-rw-r--r-- | infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/registry/UpdateFailedException.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/registry/UpdateFailedException.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/registry/UpdateFailedException.java index efb8dd524..c5848f20d 100644 --- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/registry/UpdateFailedException.java +++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/registry/UpdateFailedException.java @@ -23,12 +23,15 @@ import javax.annotation.Nonnull; /** * Thrown when CRUD operation fails. + * + * Serialization/deserialization of this exception would cause + * {@link #getProcessed()} and {@link #getFailed()} to return null. */ public class UpdateFailedException extends TranslationException { private static final long serialVersionUID = 896331856485410043L; - private final List<DataObjectUpdate> processed; - private final DataObjectUpdate failed; + private transient final List<DataObjectUpdate> processed; + private transient final DataObjectUpdate failed; /** * @param cause original cause of failure |