clojure-emacs / clj-refactor.el

A CIDER extension that provides powerful commands for refactoring Clojure code.
GNU General Public License v3.0
771 stars 111 forks source link

cljr-add-stubs fails over :import-ed Java classes #479

Open vemv opened 3 years ago

vemv commented 3 years ago

Expected behavior

cljr-add-stubs will succesfully complete a reify for a Java class that has been :imported, i.e. the symbol is not package-qualified.

Actual behavior

Errors with Can't find interface IntConsumer

Steps to reproduce the problem

clj-refactor.el version information

This repo @ master

Analysis

When there's no prefix (which is the case with :imported classes), the following LOC is executed:

https://github.com/clojure-emacs/clj-refactor.el/blob/9dcc50da7ce6f3c10276c87f09022e80c03e8bef/clj-refactor.el#L3071

which appears to mistakenly fill IntConsumer with the equivalent of (ns-name *ns*) instead of the actual java package.