I'd suggest instead amending the core language to add a special form, maybe
named .!, that works like . except it sees protected methods (and will
cause an IllegalAccessError if it calls a protected method from outside of
a subclass), and amend proxy to use .! for proxy-super (and put the
The problem is that your approach requires creating the proxy class with
the method bodies actually compiled into the body of the proxy class
method, they can't be in fns in a proxy map as they are now. This is ok in
the case where a method body is just the proxy-super call, but most aren't
- they
On Thu, Dec 26, 2013 at 6:57 PM, Colin Fleming
colin.mailingl...@gmail.comwrote:
The problem is that your approach requires creating the proxy class with
the method bodies actually compiled into the body of the proxy class
method, they can't be in fns in a proxy map as they are now. This is ok
I see. The problem is that you can't tell in advance which methods might be
called with proxy-super, so you'd have to generate proxy-super methods for
all non-public superclass methods. It's an interesting idea. I suspect it's
a fairly tricky change since you'd have to change the method resolution
Thanks Colin, I did vote for it but its title implies something
different...something restoring original binding on exception...
Jim
On 25/12/13 04:06, Colin Fleming wrote:
That is indeed the same issue, and it even includes a patch with a
test! I've voted for this one, please consider doing
Right, it doesn't fix your original problem of the reflection warning.
Thinking about it, there's no way to get rid of that warning since in the
end all interop (unless it uses a built in form) must expand to the dot
form, which has no way to call a protected method. The only solution I can
see
(Re Colin's note that a proxy gets damaged if super throws - goodness
gracious! Is it the same matter as Clojure Jira issue No.983? It's marked
as minor and affecting Clojure 1.3, and no one has voted for it.)
--
--
You received this message because you are subscribed to the Google
Groups
That is indeed the same issue, and it even includes a patch with a test!
I've voted for this one, please consider doing the same if this issue has
caught you. Link: http://dev.clojure.org/jira/browse/CLJ-983
On 25 December 2013 13:22, Matching Socks phill.w...@gmail.com wrote:
(Re Colin's note
Hi all,
is there any way to get rid of reflection in simmilar looking? Nothing
seems to work...
(proxy [JPanel ActionListener KeyListener] []
(paintComponent [^java.awt.Graphics g]
(let [^JPanel this this]
(proxy-super paintComponent g))
thanks in advance... :)
Jim
--
--
I actually just wrote a long reply detailing how to type hint 'this', and
then noticed that you've already done that! This exact case
(paintComponent) is the one reflection warning I can't get rid of in the
whole Cursive codebase, I can't figure it out either.
On 23 December 2013 01:03, Jim -
Seesaw has the same problem with paintComponent. IIRC, it's because it's
protected. I never found a workaround.
Dave
On Sunday, December 22, 2013, Colin Fleming wrote:
I actually just wrote a long reply detailing how to type hint 'this', and
then noticed that you've already done that! This
But surely proxy-super should be designed to call protected methods? I'd
have to check but I suspect I call other protected methods using it.
On 23 December 2013 14:13, Dave Ray dave...@gmail.com wrote:
Seesaw has the same problem with paintComponent. IIRC, it's because it's
protected. I
So, I poked around in the code a little, Dave is indeed right - it appears
to be impossible to remove reflection warnings for proxy-super calling
protected methods.
(defn proxy-call-with-super [call this meth]
(let [m (proxy-mappings this)]
(update-proxy this (assoc m meth nil))
(let
I've spent a night scratching my head about the behavior of proxy-super in
the presence of exceptions as well. I figured it was something like what
you found, but by that point I just didn't trust proxy that much anymore
and wrote that little bit in Java [1]. If I were a better person I would
have
14 matches
Mail list logo