You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by An...@bd.com on 2002/11/25 17:09:43 UTC

[lang] unused variables in MethodUtils

The methodName and parameterTypes variables are never used.


    public static Method getAccessibleMethod(Method method) {
...
        // Check the implemented interfaces and subinterfaces
        String methodName = method.getName();
        Class[] parameterTypes = method.getParameterTypes();
...
    }


The paramSize variable is never used.

    private static Method getMatchingAccessibleMethod(
                                                Class clazz,
                                                String methodName,
                                                Class[] parameterTypes) {
...
        } catch (NoSuchMethodException e) { /* SWALLOW */ }

        // search through all methods
        int paramSize = parameterTypes.length;
        Method[] methods = clazz.getMethods();
        for (int i = 0, size = methods.length; i < size ; i++) {
...
    }


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang] unused variables in MethodUtils

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi andy

MethodUtils is currently 'under construction'.

it started out based on the version in beanutils. that class was 
unsatisfactory since it had a poorly designed and named API and many of 
the methods had unclear contracts. on the other hand, it contains a whole 
lot of very useful workarounds for java reflection implementation bugs.

you're welcome to join in the design discussions but you need to 
understand that a lot of the implementation code is in the process of 
being moved around.

- robert

On Monday, November 25, 2002, at 04:09 PM, Andy_Freeman@bd.com wrote:

> The methodName and parameterTypes variables are never used.
>
>
>     public static Method getAccessibleMethod(Method method) {
> ...
>         // Check the implemented interfaces and subinterfaces
>         String methodName = method.getName();
>         Class[] parameterTypes = method.getParameterTypes();
> ...
>     }
>
>
> The paramSize variable is never used.
>
>     private static Method getMatchingAccessibleMethod(
>                                                 Class clazz,
>                                                 String methodName,
>                                                 Class[] parameterTypes) {
> ...
>         } catch (NoSuchMethodException e) { /* SWALLOW */ }
>
>         // search through all methods
>         int paramSize = parameterTypes.length;
>         Method[] methods = clazz.getMethods();
>         for (int i = 0, size = methods.length; i < size ; i++) {
> ...
>     }
>
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>