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 [ret (call)]
      (update-proxy this m)
      ret)))

(defmacro proxy-super
  "Use to call a superclass method in the body of a proxy method.
  Note, expansion captures 'this"
  {:added "1.0"}
  [meth & args]
 `(proxy-call-with-super (fn [] (. ~'this ~meth ~@args))  ~'this ~(name
meth)))

The method call for proxy-super just expands into the dot form, and looking
at the Compiler code that does indeed only search public methods.

There appears to be another problem with proxy-call-with-super: unless I'm
missing something, the second update-proxy should be in a finally block.
Currently if the superclass method throws an exception, the proxy will be
left with the superclass call in its proxy mappings.



On 23 December 2013 16:41, Colin Fleming <colin.mailingl...@gmail.com>wrote:

> 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 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 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 - FooBar(); <jimpil1...@gmail.com> wrote:
>>>
>>>> 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
>>>>
>>>> --
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To post to this group, send email to clojure@googlegroups.com
>>>> Note that posts from new members are moderated - please be patient with
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>> clojure+unsubscr...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> --- You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to clojure+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>  --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojure@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>  --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to