Merge branch 'dev'
This commit is contained in:
commit
77b95c5849
4 changed files with 46 additions and 21 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -1,5 +1,16 @@
|
||||||
> This project uses [Break Versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md) as of **Aug 16, 2014**.
|
> This project uses [Break Versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md) as of **Aug 16, 2014**.
|
||||||
|
|
||||||
|
## v2.9.0-RC3 / 2015 May 29
|
||||||
|
|
||||||
|
> This is a non-breaking **stability release**
|
||||||
|
|
||||||
|
* **Implementation**: more robust error handling for unthawable records
|
||||||
|
|
||||||
|
```clojure
|
||||||
|
[com.taoensso/nippy "2.9.0-RC3"]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## v2.9.0-RC2 / 2015 May 6
|
## v2.9.0-RC2 / 2015 May 6
|
||||||
|
|
||||||
> This is a non-breaking **performance release**
|
> This is a non-breaking **performance release**
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
[com.taoensso/nippy "2.8.0"] ; Stable
|
[com.taoensso/nippy "2.8.0"] ; Stable
|
||||||
[com.taoensso/nippy "2.9.0-RC2"] ; Dev, please see CHANGELOG for details
|
[com.taoensso/nippy "2.9.0-RC3"] ; Dev, please see CHANGELOG for details
|
||||||
```
|
```
|
||||||
|
|
||||||
# Nippy, a Clojure serialization library
|
# Nippy, a Clojure serialization library
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
(defproject com.taoensso/nippy "2.9.0-RC2"
|
(defproject com.taoensso/nippy "2.9.0-RC3"
|
||||||
:author "Peter Taoussanis <https://www.taoensso.com>"
|
:author "Peter Taoussanis <https://www.taoensso.com>"
|
||||||
:description "Clojure serialization library"
|
:description "Clojure serialization library"
|
||||||
:url "https://github.com/ptaoussanis/nippy"
|
:url "https://github.com/ptaoussanis/nippy"
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
:dependencies
|
:dependencies
|
||||||
[[org.clojure/clojure "1.4.0"]
|
[[org.clojure/clojure "1.4.0"]
|
||||||
[org.clojure/tools.reader "0.9.2"]
|
[org.clojure/tools.reader "0.9.2"]
|
||||||
[com.taoensso/encore "1.28.0"]
|
[com.taoensso/encore "1.32.0"]
|
||||||
[org.iq80.snappy/snappy "0.3"]
|
[org.iq80.snappy/snappy "0.3"]
|
||||||
[org.tukaani/xz "1.5"]
|
[org.tukaani/xz "1.5"]
|
||||||
[net.jpountz.lz4/lz4 "1.3"]]
|
[net.jpountz.lz4/lz4 "1.3"]]
|
||||||
|
|
|
||||||
|
|
@ -461,6 +461,7 @@
|
||||||
(encore/repeatedly-into* ~coll (quot (.readInt in#) 2)
|
(encore/repeatedly-into* ~coll (quot (.readInt in#) 2)
|
||||||
[(thaw-from-in in#) (thaw-from-in in#)])))
|
[(thaw-from-in in#) (thaw-from-in in#)])))
|
||||||
|
|
||||||
|
(def ^:private class-method-sig (into-array Class [IPersistentMap]))
|
||||||
|
|
||||||
(declare ^:private custom-readers)
|
(declare ^:private custom-readers)
|
||||||
(defn- read-custom! [type-id in]
|
(defn- read-custom! [type-id in]
|
||||||
|
|
@ -489,21 +490,40 @@
|
||||||
|
|
||||||
id-reader
|
id-reader
|
||||||
(let [edn (read-utf8 in)]
|
(let [edn (read-utf8 in)]
|
||||||
(try (edn/read-string {:readers *data-readers*} edn)
|
(try
|
||||||
(catch Exception e {:nippy/unthawable edn
|
(edn/read-string {:readers *data-readers*} edn)
|
||||||
:type :reader
|
(catch Exception e
|
||||||
:throwable e})))
|
{:type :reader
|
||||||
|
:throwable e
|
||||||
|
:nippy/unthawable edn})))
|
||||||
|
|
||||||
id-serializable
|
id-serializable
|
||||||
(let [class-name (read-utf8 in)]
|
(let [class-name (read-utf8 in)]
|
||||||
(try (let [;; .readObject _before_ Class/forName: it'll always read
|
(try
|
||||||
;; all data before throwing
|
(let [content (.readObject (ObjectInputStream. in))]
|
||||||
object (.readObject (ObjectInputStream. in))
|
(try
|
||||||
^Class class (Class/forName class-name)]
|
(let [class (Class/forName class-name)]
|
||||||
(cast class object))
|
(cast class content))
|
||||||
(catch Exception e {:nippy/unthawable class-name
|
(catch Exception e
|
||||||
:type :serializable
|
{:type :serializable
|
||||||
:throwable e})))
|
:throwable e
|
||||||
|
:nippy/unthawable {:class-name class-name :content content}})))
|
||||||
|
(catch Exception e
|
||||||
|
{:type :serializable
|
||||||
|
:throwable e
|
||||||
|
:nippy/unthawable {:class-name class-name :content nil}})))
|
||||||
|
|
||||||
|
id-record
|
||||||
|
(let [class-name (read-utf8 in)
|
||||||
|
content (thaw-from-in in)]
|
||||||
|
(try
|
||||||
|
(let [class (Class/forName class-name)
|
||||||
|
method (.getMethod class "create" class-method-sig)]
|
||||||
|
(.invoke method class (into-array Object [content])))
|
||||||
|
(catch Exception e
|
||||||
|
{:type :record
|
||||||
|
:throwable e
|
||||||
|
:nippy/unthawable {:class-name class-name :content content}})))
|
||||||
|
|
||||||
id-bytes (read-bytes in)
|
id-bytes (read-bytes in)
|
||||||
id-nil nil
|
id-nil nil
|
||||||
|
|
@ -552,12 +572,6 @@
|
||||||
id-ratio (/ (bigint (read-biginteger in))
|
id-ratio (/ (bigint (read-biginteger in))
|
||||||
(bigint (read-biginteger in)))
|
(bigint (read-biginteger in)))
|
||||||
|
|
||||||
id-record
|
|
||||||
(let [class ^Class (Class/forName (read-utf8 in))
|
|
||||||
meth-sig (into-array Class [IPersistentMap])
|
|
||||||
method ^Method (.getMethod class "create" meth-sig)]
|
|
||||||
(.invoke method class (into-array Object [(thaw-from-in in)])))
|
|
||||||
|
|
||||||
id-date (Date. (.readLong in))
|
id-date (Date. (.readLong in))
|
||||||
id-uuid (UUID. (.readLong in) (.readLong in))
|
id-uuid (UUID. (.readLong in) (.readLong in))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue