title: How do I overcome a naming conflict using Mapstruct
body: <p>My mapper:</p>
  
  <pre><code>@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE, unmappedTargetPolicy = ReportingPolicy.IGNORE)
  public interface HoursLocRecord_to_MasterHoursDtoMapper extends StandardMapper&lt;HoursLocRecord, MasterHoursDto&gt; {
          @Mapping(source = "totalOperatingHours.value", target = "totalHours")
          @Mapping(source = "trigger.value", target = "trigger")
          MasterHoursDto map(HoursLocRecord data);
  </code></pre>
  
  <p>}</p>
  
  <p>Target bean:</p>
  
  <pre><code>public class HoursDto implements IAssetInfo, Serializable {
    private Double totalHours;
    private Long trigger;
  }
  </code></pre>
  
  <p>Source bean:</p>
  
  <pre><code>public class HoursLocRecord implements Serializable {
    protected ParsedDecimal totalOperatingHours;
    protected ParsedUnsignedShort trigger;
  }
  </code></pre>
  
  <p>ParsedUnsignedShort</p>
  
  <pre><code>public class ParsedUnsignedShort {
    protected int value;
  }
  </code></pre>
  
  <p>So you can see above that Trigger is an ParsedUnsignedShort in the 'source' and a Long in the 'target'.  There is a name collision somewhere as I am getting this:</p>
  
  <blockquote>
    <p>Error:(42, 6) java: Can't map property
    "cat.tmatic.mh.domain.pl6xx.ParsedUnsignedShort trigger" to
    "java.lang.Long trigger". Consider to declare/implement a mapping
    method: "java.lang.Long
    map(cat.tmatic.mh.domain.pl6xx.ParsedUnsignedShort value)".</p>
  </blockquote>
  
  <p>The strange thing is I am not mapping those two!  I am mapping <strong>trigger.value</strong> to <strong>trigger</strong>.  I think I am getting a name collision but cannot overcome it.  We had to rename one variable to overcome this but mapstruct must be smarter than that.  Help!</p>
  
  <h2>UPDATE</h2>
  
  <p>Thanks to Rohan Bhattacharya below I remade my test without the StandardMapper.class (he didn't use it) that I was extending.  It compiled.</p>
  
  <pre><code>public interface StandardMapper&lt;From, To&gt; {
  
    /**
     * Maps from one object to another.
     */
    To map(From from);
  
    /**
     * Update the object.
     */
    To update(From from, @MappingTarget To to);
  }
  </code></pre>
  
  <p>So then I hooked it back up and removed the 'update' method and bam, it compiled. Apparently when using the @MappingTarget annotation I am getting the above error.  The generated code must try to use/create the same method and I get the mappingError.  Since I don't need the 'update' I can remove it and call this closed, but I think this is still a bug in Mapstruct.</p>