Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(wrong-type-argument stringp nil) #1129

Closed
Malabarba opened this issue Jun 13, 2015 · 10 comments
Closed

(wrong-type-argument stringp nil) #1129

Malabarba opened this issue Jun 13, 2015 · 10 comments

Comments

@Malabarba
Copy link
Member

Whenever I evaluate something that throws a ClassNotFoundException, Emacs signals the following error. However, I haven't noticed any adverse effects (the *cider-error* still pops up and looks fine).

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-name-nondirectory(nil)
  (let ((fname (file-name-nondirectory file-name))) (string-match-p "^form-init" fname))
  cider--tooling-file-p(nil)
  (if (cider--tooling-file-p file) nil (let ((buffer (cider-find-file file))) (if buffer (progn (save-current-buffer (set-buffer buffer) (save-excursion (save-restriction (widen) (goto-char ...) (forward-line ...) (move-to-column ...) (let ... ...))))))))
  (let ((file (nth 0 info)) (line (nth 1 info)) (col (nth 2 info))) (if (cider--tooling-file-p file) nil (let ((buffer (cider-find-file file))) (if buffer (progn (save-current-buffer (set-buffer buffer) (save-excursion (save-restriction ... ... ... ... ...))))))))
  (progn (let ((file (nth 0 info)) (line (nth 1 info)) (col (nth 2 info))) (if (cider--tooling-file-p file) nil (let ((buffer (cider-find-file file))) (if buffer (progn (save-current-buffer (set-buffer buffer) (save-excursion ...))))))))
  (if info (progn (let ((file (nth 0 info)) (line (nth 1 info)) (col (nth 2 info))) (if (cider--tooling-file-p file) nil (let ((buffer (cider-find-file file))) (if buffer (progn (save-current-buffer ... ...))))))))
  (let ((info (cider-extract-error-info cider-compilation-regexp message))) (if info (progn (let ((file (nth 0 info)) (line (nth 1 info)) (col (nth 2 info))) (if (cider--tooling-file-p file) nil (let ((buffer ...)) (if buffer (progn ...))))))))
  (save-excursion (let ((info (cider-extract-error-info cider-compilation-regexp message))) (if info (progn (let ((file (nth 0 info)) (line (nth 1 info)) (col (nth 2 info))) (if (cider--tooling-file-p file) nil (let (...) (if buffer ...))))))))
  cider--find-last-error-location("CompilerException java.lang.ClassNotFoundException: java.lang.Stringa, compiling:(NO_SOURCE_PATH:0:0) \n")
  (let ((loc (cider--find-last-error-location message))) (if loc (let ((overlay (make-overlay (nth 0 loc) (nth 1 loc) (nth 2 loc)))) (if overlay (let ((info (cider-extract-error-info cider-compilation-regexp message))) (if info (progn (let* ... ... ... ... ... ... ...))))))))
  cider-handle-compilation-errors("CompilerException java.lang.ClassNotFoundException: java.lang.Stringa, compiling:(NO_SOURCE_PATH:0:0) \n" #<buffer main.clj<popcorntimer>>)
  (closure ((eval-buffer . #<buffer main.clj<popcorntimer>>) (buffer) t) (_buffer err) (cider-emit-interactive-eval-err-output err) (cider-handle-compilation-errors err eval-buffer))(#<buffer main.clj<popcorntimer>> "CompilerException java.lang.ClassNotFoundException: java.lang.Stringa, compiling:(NO_SOURCE_PATH:0:0) \n")
  #[257 "\306�\307\"\306�\310\"\306�\311\"\306�\312\"\306�\313\"\306��\314\"\306��\315\"\306��\316\"\306�   \317\"\306�\n\320\"r\300q\210��\203@�\321\322!\204@�����)�  \203R�\301\205\333�\301\300��\"\202\333���\203c�\302\205\333�\302\300�    \"\202\333�\211\203r�\302\205\333�\302\300�\"\202\333���\203\203�\303\205\333�\303\300��\"\202\333��\205\333�\323��\235\203\222�\324\325!\210\326��\235\203\245�\305\206\237�� \300���$\210\327��\235\203\260�\324\330!\210\331��\235\203\273�\332\300!\210\333��\235\205\333�\334�\335���!\"�\"#\210\336��!\"\210\304\205\333�\304\300!\207" [#<buffer main.clj<popcorntimer>> (closure ((eval-buffer . #<buffer main.clj<popcorntimer>>) (buffer) t) (_buffer value) (cider--display-interactive-eval-result value)) (closure ((eval-buffer . #<buffer main.clj<popcorntimer>>) (buffer) t) (_buffer out) (cider-emit-interactive-eval-output out)) (closure ((eval-buffer . #<buffer main.clj<popcorntimer>>) (buffer) t) (_buffer err) (cider-emit-interactive-eval-err-output err) (cider-handle-compilation-errors err eval-buffer)) nil nil nrepl-dict-get "value" "ns" "out" "err" "status" "id" "ex" "root-ex" "session" "pprint-out" derived-mode-p clojure-mode "interrupted" message "Evaluation interrupted." "eval-error" "namespace-not-found" "Namespace not found." "need-input" cider-need-input "done" puthash gethash remhash cider-buffer-ns nrepl-err-handler nrepl-pending-requests nrepl-completed-requests] 16 "\n\n(fn RESPONSE)"]((dict "err" "CompilerException java.lang.ClassNotFoundException: java.lang.Stringa, compiling:(NO_SOURCE_PATH:0:0) \n" "id" "984" "session" "c232bd08-1b78-48a6-815d-0c0e536893bb"))
  nrepl--dispatch-response((dict "err" "CompilerException java.lang.ClassNotFoundException: java.lang.Stringa, compiling:(NO_SOURCE_PATH:0:0) \n" "id" "984" "session" "c232bd08-1b78-48a6-815d-0c0e536893bb"))
  nrepl-client-filter(#<process nrepl> "d3:err103:CompilerException java.lang.ClassNotFoundException: java.lang.Stringa, compiling:(NO_SOURCE_PATH:0:0) \n2:id3:9847:session36:c232bd08-1b78-48a6-815d-0c0e536893bbe")
@Malabarba
Copy link
Member Author

#1128

@expez
Copy link
Member

expez commented Jun 13, 2015

How did the code get evaluated? I've tried reproducing this with C-c C-c, C-c C-k, C-c C-l and by just evaluating (Foo.) in the repl.

@Malabarba
Copy link
Member Author

I wrote java.lang.Stringa and hit C-x C-e in a source file buffer. Though I didn't try on a clean project. Let me try.

@Malabarba
Copy link
Member Author

Ok, it doesn't happen on a clean project. So it probably has to do with clojure-on-android.

@expez
Copy link
Member

expez commented Jun 15, 2015

So it probably has to do with clojure-on-android.

Should we close this, or is there something we can do about this in cider?

@Malabarba
Copy link
Member Author

I won't be sad if we close this, but I'd like to marge that patch.
IMO, cider.el should minimize the assumptions it makes about the repl side. There are a lot of moving parts on that side, and just like I run it on a clojure-android system, so do other people run it on modified versions of clojure for one reason or another.

While it's not worth dumping a huge effort on this unusual use-cases, it can't hurt to minimize our assumptions where it's simple.

@bbatsov
Copy link
Member

bbatsov commented Jun 16, 2015

While it's not worth dumping a huge effort on this unusual use-cases, it can't hurt to minimize our assumptions where it's simple.

Still, we shouldn't suppress problems like this unless we know the root cause and that it's harmless. Right now we might end up hiding a problem somewhere else.

@bbatsov
Copy link
Member

bbatsov commented Jun 16, 2015

At the very least there should have been some mention that this is Android related. Maybe we should pinged @alexander-yakushev for input as well.

@alexander-yakushev
Copy link
Member

Yes, I've experienced that too but haven't had time to investigate.

The problem is trivial, on Android you don't have sources bundled with the application by default. For the same reason, jump-to-definition doesn't work unless you jump to a thing that was loaded/reloaded in the REPL session.

@Malabarba 's patch is a fine solution I guess.

@bbatsov
Copy link
Member

bbatsov commented Jun 16, 2015

OK, thanks for your input.

@bbatsov bbatsov closed this as completed Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants