We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No duplicated methods. leads to following error: method beanListToBeanDTOList(java.util.List<Bean>) is already defined
method beanListToBeanDTOList(java.util.List<Bean>) is already defined
public class BeanMapperImpl implements BeanMapper { @Override public BeanDTO map(Bean source, BeanDTO target) { if ( source == null ) { return target; } if ( target.getBeans() != null ) { List<BeanDTO> list = beanListToBeanDTOList( source.getBeans() ); if ( list != null ) { target.getBeans().clear(); target.getBeans().addAll( list ); } else { target.setBeans( null ); } } else { List<BeanDTO> list = beanListToBeanDTOList( source.getBeans() ); if ( list != null ) { target.setBeans( list ); } } return target; } protected List<BeanDTO> beanListToBeanDTOList(List<Bean> list) { if ( list == null ) { return null; } List<BeanDTO> list1 = new ArrayList<BeanDTO>( list.size() ); for ( Bean bean : list ) { list1.add( beanToBeanDTO( bean ) ); } return list1; } protected BeanDTO beanToBeanDTO(Bean bean) { if ( bean == null ) { return null; } BeanDTO beanDTO = new BeanDTO(); beanDTO.setBeans( beanListToBeanDTOList( bean.getBeans() ) ); return beanDTO; } protected List<BeanDTO> beanListToBeanDTOList(List<Bean> list) { if ( list == null ) { return null; } List<BeanDTO> list1 = new ArrayList<BeanDTO>( list.size() ); for ( Bean bean : list ) { list1.add( beanToBeanDTO( bean ) ); } return list1; } }
SourceFiles to reproduce:
public class Bean { private List<Bean> beans; public List<Bean> getBeans() { return beans; } public void setBeans(List<Bean> beans) { this.beans = beans; } }
public class BeanDTO { private List<BeanDTO> beans; public List<BeanDTO> getBeans() { return beans; } public void setBeans(List<BeanDTO> beans) { this.beans = beans; } }
@Mapper public interface BeanMapper { BeanMapper INSTANCE = Mappers.getMapper(BeanMapper.class); @Mapping(source = "beans", target = "beans") BeanDTO map(Bean source, @MappingTarget BeanDTO target); }
1.5.5.Final
The text was updated successfully, but these errors were encountered:
mapstruct#3591 Potential fix for duplicate methods generated.
69d698f
mapstruct#3591 Use forged method under creation if it exists
37d89e5
mapstruct#3591 ContainerMappingMethod: create empty selectionParamete…
0b90068
…rs if null
No branches or pull requests
Expected behavior
No duplicated methods.
leads to following error:
method beanListToBeanDTOList(java.util.List<Bean>) is already defined
Actual behavior
Steps to reproduce the problem
SourceFiles to reproduce:
MapStruct Version
1.5.5.Final
The text was updated successfully, but these errors were encountered: