#277 fixing faulty match check in built-in methods on return/target type...

....

The check was carried out in the wrong direction. Iso carrying out if a return type is assignable to a target type, MapStruct checked the other way around (target type assignable to return type). 

In fixing, this poses a problem for a typed variable, e.g. `<T> T jaxbElemToValue( JAXBElement<T> element )`. The erasure of the return type is an Object, which is never assignable to, lets say T being a String.

Therefore to additional checks have been added on the assumption that a a Typed variable erasure is an java.lang.Object. 

So the full check now is:
```java
        if ( getReturnType().erasure().isAssignableTo( targetType.erasure() )
            && sourceType.erasure().isAssignableTo( getParameter().getType().erasure() ) ) {
            return doTypeVarsMatch( sourceType, targetType );
        }
        if ( getReturnType().erasure().getFullyQualifiedName().equals( "java.lang.Object" )
            && sourceType.erasure().isAssignableTo( getParameter().getType().erasure() ) ) {
            // return type could be a type parameter T
            return doTypeVarsMatch( sourceType, targetType );
        }
        if ( getReturnType().erasure().isAssignableTo( targetType.erasure() )
            &&  getParameter().getType().erasure().getFullyQualifiedName().equals( "java.lang.Object" ) ) {
            // parameter type could be a type parameter T
            return doTypeVarsMatch( sourceType, targetType );
        }
        return false;
```
Perhaps there are more elegant ways to achieve this than a String equals check on the FQN.
Can you give an example?

AFAIK the only thing erasure does is removing the type parameters, right? Equals then works. Since the builtinmehod does not have any, the erasure can be removed from the getReturntype and the getArameter.


> Op 16 aug. 2014 om 12:10 heeft Andreas Gudian <notifications@github.com> het volgende geschreven:
> 
> In processor/src/main/java/org/mapstruct/ap/model/source/builtin/BuiltInMethod.java:
> 
> >              && sourceType.erasure().isAssignableTo( getParameter().getType().erasure() ) ) {
> >              return doTypeVarsMatch( sourceType, targetType );
> >          }
> > +        if ( getReturnType().erasure().getFullyQualifiedName().equals( "java.lang.Object" )
> Funny enough, the implementation of erasure() results in a Type instance with the same fullyQualifiedName as the original type... I guess that needs to be corrected, too. :)
> 
> —
> Reply to this email directly or view it on GitHub.