Field notation returns garbage suggestion #31

Closed
kumarshantanu opened this Issue May 18, 2012 · 2 comments

2 participants

@kumarshantanu

For the s-expr (. Thread (sleep (read-string sleep-time))) Kibit 0.0.3 suggests (.clojure.lang.LazySeq@7bcd9a98 Thread)

@jonase
Owner

The suggestion should be (Thread/sleep (read-string sleep-time)). I'll try to fix this, thanks for the report!

@kumarshantanu

You may also like to consider this:

Thread/sleep can potentially throw InterruptedException. It is a very common error not to catch that exception. Ideally, the sleep usage should look like this:

(try (Thread/sleep number-of-milliseconds)
  (catch InterruptedException e
    (.interrupt (Thread/currentThread))))
@jonase jonase added a commit that referenced this issue May 20, 2012
@jonase fixed issue #31 0f6bbc6
@jonase jonase closed this May 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment