I was afraid that you were going to say something like that :).. I’ll have a look how I can solve this..


On 6 feb. 2014, at 21:59, Gunnar Morling <notifications@github.com> wrote:

> In processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java:
> 
> > @@ -170,7 +169,8 @@ private ReportingPolicy getEffectiveUnmappedTargetPolicy(TypeElement element) {
> >                  continue;
> >              }
> >  
> > -            reportErrorIfNoImplementationTypeIsRegisteredForInterfaceReturnType( method );
> > +           // TODO: Either find a good check for this or remove?
> > +           // reportErrorIfNoImplementationTypeIsRegisteredForInterfaceReturnType( method );
> Ah, got it now. In case a generated method uses a factory method to instantiate the return value, this check needs to be suppressed. So you'd have to pull out the retrieval of the factory method and pass the fact whether such factory method is present or not into this reporting method. Only if there is no factory method and no registered implementation type, the error should be raised.
> 
> —
> Reply to this email directly or view it on GitHub.
>