{"action":"created","issue":{"url":"https://api.github.com/repos/clojure-emacs/clj-refactor.el/issues/207","labels_url":"https://api.github.com/repos/clojure-emacs/clj-refactor.el/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/clojure-emacs/clj-refactor.el/issues/207/comments","events_url":"https://api.github.com/repos/clojure-emacs/clj-refactor.el/issues/207/events","html_url":"https://github.com/clojure-emacs/clj-refactor.el/issues/207","id":101045557,"number":207,"title":"I got the error when using `cn`.","user":{"login":"vmfhrmfoaj","id":7251822,"avatar_url":"https://avatars.githubusercontent.com/u/7251822?v=3","gravatar_id":"","url":"https://api.github.com/users/vmfhrmfoaj","html_url":"https://github.com/vmfhrmfoaj","followers_url":"https://api.github.com/users/vmfhrmfoaj/followers","following_url":"https://api.github.com/users/vmfhrmfoaj/following{/other_user}","gists_url":"https://api.github.com/users/vmfhrmfoaj/gists{/gist_id}","starred_url":"https://api.github.com/users/vmfhrmfoaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmfhrmfoaj/subscriptions","organizations_url":"https://api.github.com/users/vmfhrmfoaj/orgs","repos_url":"https://api.github.com/users/vmfhrmfoaj/repos","events_url":"https://api.github.com/users/vmfhrmfoaj/events{/privacy}","received_events_url":"https://api.github.com/users/vmfhrmfoaj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-14T16:18:25Z","updated_at":"2015-08-14T16:44:49Z","closed_at":"2015-08-14T16:44:49Z","body":"I use `cider-nrepl` \"0.10.0-SNAPSHOT\", `refactor-nrepl` \"1.2.0-SNAPSHOT\"\r\n\r\nsource file:\r\n```clojure\r\n(ns adb.help\r\n  (:refer-clojure :exclude [range])\r\n  (:import (com.android.ddmlib RawImage) ;; work fine remove the parenthesis (i.e. (com.android.ddmlib RawImage) -> com.android.ddmlib.RawImage)\r\n           (java.awt.image     BufferedImage)))\r\n\r\n(def ^:private range (memoize (comp doall clojure.core/range)))\r\n\r\n(def ^:private n-cpu (.. Runtime getRuntime availableProcessors))\r\n\r\n(defn raw->img!\r\n  \"Convert, `ddmlib.RawImage' -> `awt.image.BufferedImage'\"\r\n  [raw img]\r\n  (let [w (.-width  raw)\r\n        h (.-height raw)\r\n        byte-per-pixel (/ (.-bpp raw) 8)]\r\n    (->> (range 0 (* w h) (/ (* w h) n-cpu))\r\n         ((juxt identity\r\n                (comp #(concat % (list (* w h)))\r\n                      (partial drop 1))))\r\n         (apply interleave)\r\n         (partition 2)\r\n         (pmap (fn [[s e]]\r\n                 (let [px (rem s w)\r\n                       py (/   s w)\r\n                       pw w\r\n                       ph (/ (- e s) w)\r\n                       rgb-array (->> (range s e)\r\n                                      (map #(.getARGB ^RawImage raw (* % byte-per-pixel)))\r\n                                      int-array)]\r\n                   (.setRGB ^BufferedImage img, px py, pw ph, rgb-array, 0, w))))\r\n         dorun)\r\n    img))\r\n\r\n(defn raw->img\r\n  \"Convert, `ddmlib.RawImage' -> `awt.image.BufferedImage'\"\r\n  [raw]\r\n  (let [img (BufferedImage. (.-width  raw)\r\n                            (.-height raw)\r\n                            BufferedImage/TYPE_INT_ARGB)]\r\n    (raw->img! raw img)))\r\n```\r\n\r\n>java.lang.NullPointerException: null\r\n> at clojure.lang.Symbol.intern (Symbol.java:60)\r\n>    clojure.core$symbol.invoke (core.clj:546)\r\n>    refactor_nrepl.ns.rebuild$create_import_form.invoke (rebuild.clj:184)\r\n>    refactor_nrepl.ns.rebuild$create_import_components$iter__15630__15634$fn__15635.invoke (rebuild.clj:189)\r\n>    clojure.lang.LazySeq.sval (LazySeq.java:40)\r\n>    clojure.lang.LazySeq.seq (LazySeq.java:49)\r\n>    clojure.lang.RT.seq (RT.java:484)\r\n>    clojure.core$seq.invoke (core.clj:133)\r\n>    clojure.core$map$fn__4245.invoke (core.clj:2551)\r\n>    clojure.lang.LazySeq.sval (LazySeq.java:40)\r\n>    clojure.lang.LazySeq.seq (LazySeq.java:49)\r\n>    clojure.lang.RT.seq (RT.java:484)\r\n>    clojure.core$seq.invoke (core.clj:133)\r\n>    clojure.core$sort.invoke (core.clj:2827)\r\n>    refactor_nrepl.ns.rebuild$sort_imports.invoke (rebuild.clj:194)\r\n>    refactor_nrepl.ns.rebuild$build_import_form.invoke (rebuild.clj:202)\r\n>    refactor_nrepl.ns.rebuild$rebuild_ns_form.invoke (rebuild.clj:235)\r\n>    refactor_nrepl.ns.clean_ns$clean_ns.invoke (clean_ns.clj:38)\r\n>    refactor_nrepl.middleware$clean_ns_reply.invoke (middleware.clj:73)\r\n>    refactor_nrepl.middleware$wrap_refactor$fn__16072.invoke (middleware.clj:120)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    cider.nrepl.middleware.inspect$wrap_inspect$fn__3730.invoke (inspect.clj:108)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    clojure.tools.nrepl.middleware.pr_values$pr_values$fn__977.invoke (pr_values.clj:17)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    cider.nrepl.middleware.complete$wrap_complete$fn__3423.invoke (complete.clj:52)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    cider.nrepl.middleware.undef$wrap_undef$fn__7900.invoke (undef.clj:30)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    cider.nrepl.middleware.debug$wrap_debug$fn__3892.invoke (debug.clj:352)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    cider.nrepl.middleware.test$wrap_test$fn__7605.invoke (test.clj:201)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    clojure.tools.nrepl.middleware.session$session$fn__1106.invoke (session.clj:192)\r\n>    clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__797.invoke (middleware.clj:24)\r\n>    clojure.tools.nrepl.server$handle_STAR_.invoke (server.clj:19)\r\n>    clojure.tools.nrepl.server$handle$fn__1170.invoke (server.clj:28)\r\n>    clojure.core$binding_conveyor_fn$fn__4145.invoke (core.clj:1910)\r\n>    clojure.lang.AFn.call (AFn.java:18)\r\n>    java.util.concurrent.FutureTask.run (FutureTask.java:266)\r\n>    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)\r\n>    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)\r\n>    java.lang.Thread.run (Thread.java:745)"},"comment":{"url":"https://api.github.com/repos/clojure-emacs/clj-refactor.el/issues/comments/131175382","html_url":"https://github.com/clojure-emacs/clj-refactor.el/issues/207#issuecomment-131175382","issue_url":"https://api.github.com/repos/clojure-emacs/clj-refactor.el/issues/207","id":131175382,"user":{"login":"expez","id":1006557,"avatar_url":"https://avatars.githubusercontent.com/u/1006557?v=3","gravatar_id":"","url":"https://api.github.com/users/expez","html_url":"https://github.com/expez","followers_url":"https://api.github.com/users/expez/followers","following_url":"https://api.github.com/users/expez/following{/other_user}","gists_url":"https://api.github.com/users/expez/gists{/gist_id}","starred_url":"https://api.github.com/users/expez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/expez/subscriptions","organizations_url":"https://api.github.com/users/expez/orgs","repos_url":"https://api.github.com/users/expez/repos","events_url":"https://api.github.com/users/expez/events{/privacy}","received_events_url":"https://api.github.com/users/expez/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T16:44:49Z","updated_at":"2015-08-14T16:44:49Z","body":"Fixed in https://github.com/clojure-emacs/refactor-nrepl/commit/7eb38e1ac45121835a27dc2a57ce5e3f06e42aad (messed up the issue reference :/)\r\n\r\nI've also deployed a new snapshot to clojars. \r\n\r\nThanks for the excellent bugreport @vmfhrmfoaj! "}}