From 232376d2b7d795a22b2e3047f939c22ba43fb5a2 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 19 May 2015 07:34:19 +0100 Subject: [PATCH] Add support for copy to/from native memory for interop with java-lang. --- .../hash/serialization/internal/CopyingMetaBytesInterop.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/openhft/chronicle/hash/serialization/internal/CopyingMetaBytesInterop.java b/src/main/java/net/openhft/chronicle/hash/serialization/internal/CopyingMetaBytesInterop.java index d778a5c2b..3b55741b6 100644 --- a/src/main/java/net/openhft/chronicle/hash/serialization/internal/CopyingMetaBytesInterop.java +++ b/src/main/java/net/openhft/chronicle/hash/serialization/internal/CopyingMetaBytesInterop.java @@ -31,6 +31,8 @@ public abstract class CopyingMetaBytesInterop extends BasicCopyingMetaByte private static final long MAX_REASONABLE_SERIALIZED_SIZE = MemoryUnit.MEGABYTES.toBytes(16L); public static void checkMaxSizeStillReasonable(long maxSize, Exception ex) { + if (ex != null) + throw new IllegalStateException("Unable to serialize the object " + ex, ex); if (maxSize > MAX_REASONABLE_SERIALIZED_SIZE) { throw new IllegalStateException("We try to figure out size of objects " + "in serialized form, but it exceeds " +