Clojure

gen-class does not preserve parameter names of overridden methods

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not Reproducible
  • Affects Version/s: Release 1.8
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Approval:
    Triaged

Description

Parameters names are not preserved during classes generation. It relates to interfaces and abstract classes clojure class inherited from as well as the methods declared in :methods part of the gen-class.

It would be useful to preserve names so that java programmers that use clojure libraries wouldn't be confused.

Steps to reproduce:
1. Declare java interface or abstract class with methods to implement in clojure.
2. Use gen-class to generate jar:

(ns foo.bar.core
  (:gen-class
    :name foo.bar.ClientImpl
    :extends foo.bar.AbstractClient
    :main false
    :methods [[method [String] void]]))

3. Add resulted jar in other java project.
4. Methods parameters looks like s1, aLong1 etc (like it shown in the attached screen shot).

Complete example is here

Activity

Hide
Maxim Neverov added a comment -

:uberjar did the trick. Ticket can be closed. Sorry for inconvenience.

Show
Maxim Neverov added a comment - :uberjar did the trick. Ticket can be closed. Sorry for inconvenience.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: