Clojure

proxy-name does not produce unique names

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.1
  • Component/s: None
  • Labels:
    None
  • Approval:
    Ok

Description

be.nsa.server=> (proxy-name Object [Signal$Listener])
"clojure.proxy.java.lang.Object$Listener"
be.nsa.server=> (proxy-name Object [Signal1$Listener])
"clojure.proxy.java.lang.Object$Listener"

Proposed solution: include more than the simple name of interfaces (up to the last dot) and a hash of the full names.

eg : (proxy-name Object [Signal1$Listener])
"clojure.proxy.java.lang.Object$Signal1$Listener$af458"
(proxy-name Object [Signal1$Listener])
"clojure.proxy.java.lang.Object$Signal$Listener$4d54e"

Wouldn't the hash suffice?

Activity

Hide
Assembla Importer added a comment -

meikelbrandmeyer said: I'd like to add, that it would be nice, if the current namespace could also be included in the class generated by proxy. In it's current form it is very difficult to create several jars from one compilation tree, since it is difficult to find out which namespace defines which proxy.

The current solution requires to set up different compilation trees for different jars. Especially for simple setups this is a lot of unnecessary work.

Having the namespace encoded in the class name would make it easy to select the correct proxy classes.

Also, it would avoid clashes with third party libraries, which happen to define similar proxies.

Show
Assembla Importer added a comment - meikelbrandmeyer said: I'd like to add, that it would be nice, if the current namespace could also be included in the class generated by proxy. In it's current form it is very difficult to create several jars from one compilation tree, since it is difficult to find out which namespace defines which proxy. The current solution requires to set up different compilation trees for different jars. Especially for simple setups this is a lot of unnecessary work. Having the namespace encoded in the class name would make it easy to select the correct proxy classes. Also, it would avoid clashes with third party libraries, which happen to define similar proxies.
Hide
Assembla Importer added a comment -

cgrand said: Attached patch:
proxy now caches generated classes per namespace and include a hash to distinguish proxy classes implementing homonymous interfaces. See #181

Show
Assembla Importer added a comment - cgrand said: Attached patch: proxy now caches generated classes per namespace and include a hash to distinguish proxy classes implementing homonymous interfaces. See #181
Hide
Assembla Importer added a comment -

richhickey said: I don't see the patch file

Show
Assembla Importer added a comment - richhickey said: I don't see the patch file
Hide
Assembla Importer added a comment -

cgrand said: [file:au3qQmLWur3Rb-eJe5afGb]: missing patch

Show
Assembla Importer added a comment - cgrand said: [file:au3qQmLWur3Rb-eJe5afGb]: missing patch
Hide
Assembla Importer added a comment -

cgrand said: (In [[r:e73abece1ebf3a4aba22104ae9452b2b816ab0d7]]) proxy now caches generated classes per namespace and include a hash to distinguish proxy classes implementing homonymous interfaces. Fixes #181

Signed-off-by: Chouser <chouser@n01se.net>

Branch: master

Show
Assembla Importer added a comment - cgrand said: (In [[r:e73abece1ebf3a4aba22104ae9452b2b816ab0d7]]) proxy now caches generated classes per namespace and include a hash to distinguish proxy classes implementing homonymous interfaces. Fixes #181 Signed-off-by: Chouser <chouser@n01se.net> Branch: master

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: