I know.. But this one was deliberate. It makes the MethodMatcher immediately usable for a multi-arg match. Although, currently not used.


On 4 jan. 2014, at 12:11, Gunnar Morling <notifications@github.com> wrote:

> In processor/src/main/java/org/mapstruct/ap/util/MethodMatcher.java:
> 
> > +    private boolean typesMatch = true;
> > +    private Map<TypeVariable, TypeMirror> genericTypesMap = new HashMap<TypeVariable, TypeMirror>();
> > +
> > +    public MethodMatcher(Types typeUtils, Method candidateMethod, Type returnType, Type... arguments) {
> > +        this.typeUtils = typeUtils;
> > +        this.candidateMethod = candidateMethod;
> > +        this.parameters = arguments;
> > +        this.returnType = returnType;
> > +    }
> > +
> > +    public boolean matches() {
> > +
> > +        // check & collect generic types.
> > +        List<? extends VariableElement> candidateParameters = candidateMethod.getExecutable().getParameters();
> > +        if ( candidateParameters.size() == parameters.length ) {
> > +            for ( int i = 0; i < parameters.length; i++ ) {
> What I mean is, the var-args parameter of the MethodMatcher constructor is only invoked with a single element, so AFAICS the parameters property could be a single Type instead of a Type array.
> 
> —
> Reply to this email directly or view it on GitHub.
>