technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.
Other
473 stars 38 forks source link

Unable to generate ns clause: can't resolve java classes #2

Closed dakrone closed 13 years ago

dakrone commented 13 years ago

I'm seeing this issue in a couple of my projects:

(ns cheshire.core
  (:use [cheshire.parse :only [parse]]
        [cheshire.generate :only [generate]])
  (:import (org.codehaus.jackson.smile SmileFactory)
           (org.codehaus.jackson JsonFactory JsonParser JsonParser$Feature
                                 JsonGenerator)
           (java.io StringWriter StringReader BufferedReader
                    ByteArrayOutputStream)))
‹ ~/src/clj/cheshire master› ∴ lein slamhound src/cheshire/core.clj 
Exception in thread "main" java.lang.Exception: Couldn't resolve JsonParser (NO_SOURCE_FILE:1)
        at clojure.lang.Compiler.eval(Compiler.java:5440)
        at clojure.lang.Compiler.eval(Compiler.java:5415)
        at clojure.lang.Compiler.eval(Compiler.java:5415)
        at clojure.lang.Compiler.eval(Compiler.java:5391)
        at clojure.core$eval.invoke(core.clj:2382)
        at clojure.main$eval_opt.invoke(main.clj:235)
        at clojure.main$initialize.invoke(main.clj:254)
        at clojure.main$null_opt.invoke(main.clj:279)
        at clojure.main$main.doInvoke(main.clj:354)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:369)
        at clojure.lang.AFn.applyToHelper(AFn.java:163)
        at clojure.lang.Var.applyTo(Var.java:482)
        at clojure.main.main(main.java:37)
Caused by: java.lang.Exception: Couldn't resolve JsonParser
        at slam.hound.regrow$regrow.invoke(regrow.clj:74)
        at slam.hound.regrow$regrow.invoke(regrow.clj:70)
        at slam.hound$reconstruct.invoke(hound.clj:10)
        at user$eval368.invoke(NO_SOURCE_FILE:1)
        at clojure.lang.Compiler.eval(Compiler.java:5424)
        ... 13 more
lein slamhound src/cheshire/core.clj  15.29s user 0.82s system 230% cpu 7.002 total

For this project: https://github.com/dakrone/cheshire

I've noticed the same error for my other projects that have java dependencies in the NS clause (like clojure-opennlp).

technomancy commented 13 years ago

Fixed in 1.1.0; thanks.