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

Error handling response - class java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/psi/search/FilenameIndex.getVirtualFilesByName must not be null #2712

Closed
galatyn opened this issue Jul 6, 2022 · 1 comment
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@galatyn
Copy link

galatyn commented Jul 6, 2022

What steps will reproduce the issue?
Run Clojure app in Idea with REPL. Then run test from Idea:

(ns demo-cursive-error.core-test
  (:require
    [clojure.test :refer :all]
    [ring.mock.request :as mr]
    [metrics.ring.instrument :as ri]
    [reitit.ring :as ring]
    [reitit.core :as r]))

(def test-api
  (ring/router
    [["" {:post {:name ::test
                 :handler (fn [& _]
                            (is true))}}]]))

(def router
  (ring/router
    [["/test" (r/routes test-api)]]))

(deftest min-test
  (let [handler (-> (ring/ring-handler router)
                    ri/instrument)]
    (-> (mr/request :post "/test")
        (handler))))

Dependencies:

:dependencies [[org.clojure/clojure "1.11.1"]
                 [ring/ring-mock "0.4.0"]
                 [metrics-clojure-ring "2.10.0"]
                 [metosin/reitit-ring "0.5.18"]
                 [metosin/reitit-core "0.5.18"]]

IDEA project with the test can be found here: https://github.com/galatyn/demo-cursive-error

What is the expected result?

Test should pass.
It worked on earlier versions Idea/Cursive.

What happens instead?

Test failed with the following errors in console:

Clojure 1.11.1
nREPL server started on port 52242 on host 127.0.0.1 - nrepl://127.0.0.1:52242
Loading test/demo_cursive_error/core_test.clj... done
Running demo-cursive-error.core-test/min-test
Error handling response - class java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/psi/search/FilenameIndex.getVirtualFilesByName must not be null
Error handling response - class java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/psi/search/FilenameIndex.getVirtualFilesByName must not be null
Error handling response - class java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/psi/search/FilenameIndex.getVirtualFilesByName must not be null
Error handling response - class java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/psi/search/FilenameIndex.getVirtualFilesByName must not be null
Error handling response - class java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/psi/search/FilenameIndex.getVirtualFilesByName must not be null

Env:

  • macOS 12.4

  • Idea 2022.1.3 (Ultimate edition)
    Build #IU-221.5921.22, built on June 21, 2022

    Runtime version: 11.0.15+10-b2043.56 x86_64

    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

  • Cursive 1.12.4-2022.1

  • Module JDK: semuru-11.java version "11.0.13"

Stacktrace:

java.lang.Throwable: Error handling response
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/psi/search/FilenameIndex.getVirtualFilesByName must not be null
 at com.intellij.psi.search.FilenameIndex.$$$reportNull$$$0 (FilenameIndex.java:-1)
    com.intellij.psi.search.FilenameIndex.getVirtualFilesByName (FilenameIndex.java:-1)
    cursive.testing.actions$file_matching_trace_item_QMARK_$reify__10595.compute (actions.clj:281)
    com.intellij.openapi.application.impl.ApplicationImpl.runReadAction (ApplicationImpl.java:920)
    cursive.testing.actions$file_matching_trace_item_QMARK_.invokeStatic (actions.clj:280)
    cursive.testing.actions$file_matching_trace_item_QMARK_.invoke (actions.clj:279)
    cursive.testing.actions$process_trace$fn__10608.invoke (actions.clj:312)
    clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
    clojure.core$reduce.invokeStatic (core.clj:6852)
    clojure.core$reduce.invoke (core.clj:6835)
    cursive.testing.actions$process_trace.invokeStatic (actions.clj:309)
    cursive.testing.actions$process_trace.invoke (actions.clj:308)
    cursive.testing.actions$find_element_for_item.invokeStatic (actions.clj:328)
    cursive.testing.actions$find_element_for_item.invoke (actions.clj:323)
    cursive.testing.actions$fn__10684.invokeStatic (actions.clj:460)
    cursive.testing.actions/fn (actions.clj:455)
    clojure.lang.MultiFn.invoke (MultiFn.java:229)
    cursive.testing.actions$test_handler$process__10700.invoke (actions.clj:514)
    cursive.testing.actions$test_handler$reify__10703.out (actions.clj:525)
    cursive.repl.nrepl$handler.invokeStatic (nrepl.clj:78)
    cursive.repl.nrepl$handler.invoke (nrepl.clj:61)
    cursive.repl.nrepl$start$reify__5270$fn__5278.invoke (nrepl.clj:141)
    cursive.repl.nrepl$start$reify__5270.run (nrepl.clj:140)
    com.intellij.openapi.application.impl.ApplicationImpl$1.run (ApplicationImpl.java:295)
    java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
    java.util.concurrent.FutureTask.run (FutureTask.java:264)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:668)
    java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:665)
    java.security.AccessController.doPrivileged (AccessController.java:-2)
    java.util.concurrent.Executors$PrivilegedThreadFactory$1.run (Executors.java:665)
    java.lang.Thread.run (Thread.java:829)

	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
	at cursive.logging$do_error.invokeStatic(logging.clj:60)
	at cursive.logging$do_error.invoke(logging.clj:59)
	at cursive.logging$do_log.invokeStatic(logging.clj:45)
	at cursive.logging$do_log.doInvoke(logging.clj:38)
	at clojure.lang.RestFn.invoke(RestFn.java:464)
	at cursive.repl$print_exception.invokeStatic(repl.clj:153)
	at cursive.repl$print_exception.invoke(repl.clj:151)
	at cursive.repl.nrepl$start$reify__5270$fn__5278.invoke(nrepl.clj:143)
	at cursive.repl.nrepl$start$reify__5270.run(nrepl.clj:140)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:295)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)
@cursive-ide cursive-ide added this to the 1.12.5 milestone Jul 29, 2022
@cursive-ide
Copy link
Owner

Thanks for the excellent reproduction case, and my apologies for the long delay. This is fixed for the next build.

@cursive-ide cursive-ide modified the milestones: 1.12.5, 1.12.5-eap1 Aug 3, 2022
@cursive-ide cursive-ide added the bug Marks issues describing bugs label Aug 3, 2022
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

2 participants