struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: I never knew! super class to subclass method lookup issue
Date Thu, 15 May 2003 01:09:20 GMT
Well, the twist there is that getDeclaredMethod won't return an 
inherited method, but getMethod will (IIRC).

Brandon Goodin wrote:
> So then I should use the getDeclaredMethod() instead? If yes, then this
> needs to be changed in the DispatchActions method lookup.
> 
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> mail@phase.ws
> http://www.phase.ws
> 
> 
> -----Original Message-----
> From: Kris Schneider [mailto:kris@dotech.com]
> Sent: Wednesday, May 14, 2003 6:04 PM
> To: Struts Users Mailing List
> Subject: Re: I never knew! super class to subclass method lookup issue
> 
> 
>  From Class.getMethod:
> 
> Returns a Method object that reflects the specified public member method
> of the class or interface represented by this Class object.
> 
> So, by invoking Class.getMethod, DispatchAction.getMethod is explicitly
> saying it only wants a public method.
> 
> Brandon Goodin wrote:
> 
>>A super class cannot see a subclass's protected methods via reflection.
> 
> For
> 
>>example, when DispatchAction is extended all methods in the extended
>>DispatchAction that will be "looked up" MUST be public and cannot be
>>protected. If they are protected then the super class CANNOT see the
>>subclasses protected methods via reflection usings the getMethods()...
>>
>>Does this seem like odd behavior for java to implement or is there a good
>>reason?
>>
>>Brandon Goodin
> 
> 
> --
> Kris Schneider <mailto:kris@dotech.com>
> D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message