diff --git a/project.clj b/project.clj index 1c0f74d..5404c04 100644 --- a/project.clj +++ b/project.clj @@ -11,7 +11,7 @@ :1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]} :dev {:dependencies []} :test {:dependencies [[org.xerial.snappy/snappy-java "1.0.5-M3"]]} - :bench {:dependencies [] :jvm-opts ["-server"]}} + :bench {:dependencies [] :jvm-opts ^:replace ["-server"]}} :aliases {"test-all" ["with-profile" "test,1.4:test,1.5:test,1.6" "expectations"] "test-auto" ["with-profile" "test" "autoexpect"] "start-dev" ["with-profile" "dev,test,bench" "repl" ":headless"] diff --git a/src/taoensso/nippy.clj b/src/taoensso/nippy.clj index 499d3d9..b742f6c 100644 --- a/src/taoensso/nippy.clj +++ b/src/taoensso/nippy.clj @@ -8,9 +8,6 @@ (encryption :as encryption :refer (aes128-encryptor))]) (:import [java.io DataInputStream DataOutputStream ByteArrayOutputStream ByteArrayInputStream] - ;; [java.io DataInputStream DataOutputStream] - ;;[cc.qbits.grease.io FastByteArrayInputStream - ;;FastByteArrayOutputStream] [clojure.lang Keyword BigInt Ratio PersistentQueue PersistentTreeMap PersistentTreeSet IPersistentList IPersistentVector IPersistentMap IPersistentSet IPersistentCollection])) diff --git a/src/taoensso/nippy/compression.clj b/src/taoensso/nippy/compression.clj index 0ec7f01..e5e895e 100644 --- a/src/taoensso/nippy/compression.clj +++ b/src/taoensso/nippy/compression.clj @@ -17,4 +17,4 @@ (decompress [_ ba] (org.iq80.snappy.Snappy/uncompress ba 0 (alength ^bytes ba)))) (def snappy-compressor "Default org.iq80.snappy.Snappy compressor." - (SnappyCompressor.)) \ No newline at end of file + (->SnappyCompressor)) \ No newline at end of file diff --git a/src/taoensso/nippy/encryption.clj b/src/taoensso/nippy/encryption.clj index 25ac362..f324dc9 100644 --- a/src/taoensso/nippy/encryption.clj +++ b/src/taoensso/nippy/encryption.clj @@ -129,7 +129,7 @@ Faster than `aes128-salted`, and harder to attack any particular key - but increased danger if a key is somehow compromised." - (AES128Encryptor. (atom {}))) + (->AES128Encryptor (atom {}))) ;;;; Default implementation diff --git a/src/taoensso/nippy/tools.clj b/src/taoensso/nippy/tools.clj index b362b3b..6656805 100644 --- a/src/taoensso/nippy/tools.clj +++ b/src/taoensso/nippy/tools.clj @@ -11,7 +11,7 @@ (defn wrap-for-freezing "Wraps arg (any freezable data type) so that (tools/freeze ) will serialize the arg using given options." - [value & [opts]] (WrappedForFreezing. value opts)) + [value & [opts]] (->WrappedForFreezing value opts)) (defn freeze "Like `nippy/freeze` but takes options from special argument wrapper when diff --git a/src/taoensso/nippy/utils.clj b/src/taoensso/nippy/utils.clj index ce57780..de65983 100644 --- a/src/taoensso/nippy/utils.clj +++ b/src/taoensso/nippy/utils.clj @@ -87,9 +87,9 @@ (defn ba-split [^bytes ba ^Integer idx] (let [s (alength ba)] (when (> s idx) - [(java.util.Arrays/copyOfRange ba 0 idx) + [(java.util.Arrays/copyOf ba idx) (java.util.Arrays/copyOfRange ba idx s)]))) (comment (String. (ba-concat (.getBytes "foo") (.getBytes "bar"))) (let [[x y] (ba-split (.getBytes "foobar") 5)] - [(String. x) (String. y)])) + [(String. x) (String. y)])) \ No newline at end of file