From 7925982939a3510548fd65df24de883d6be83554 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Mon, 7 Jul 2014 12:41:16 +0700 Subject: [PATCH] Print warning when replacing a custom type reader --- src/taoensso/nippy.clj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/taoensso/nippy.clj b/src/taoensso/nippy.clj index 928cee9..418f960 100644 --- a/src/taoensso/nippy.clj +++ b/src/taoensso/nippy.clj @@ -685,6 +685,9 @@ (->MyType (.readUTF data-input)))" [custom-type-id [in] & body] (assert-custom-type-id custom-type-id) + (when (contains? @custom-readers (coerce-custom-type-id custom-type-id)) + (println (format "Warning: resetting Nippy thaw for custom type with id: %s" + custom-type-id))) `(swap! custom-readers assoc ~(coerce-custom-type-id custom-type-id) (fn [~(with-meta in {:tag 'java.io.DataInput})]