orika-mapper/orika

java.lang.StackOverflowError: null

MoleInTheField opened this issue · 2 comments

I use version is 1.4.6
maven:

<dependency>
  <groupId>ma.glasnost.orika</groupId>
  <artifactId>orika-core</artifactId>
  <version>1.4.6</version>
</dependency>

Initial mode:

public class BeanMapper {

    private static MapperFacade mapper;

    static {
        MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
        mapper = mapperFactory.getMapperFacade();
    }
   
   public static <S, D> List<D> mapList(Iterable<S> sourceList, Type<S> sourceType, Type<D> destinationType) {
        return mapper.mapAsList(sourceList, sourceType, destinationType);
    }

   public static <E> Type<E> getType(final Class<E> rawType) {
        return TypeFactory.valueOf(rawType);
    }
}

Execute the following code:
BeanMapper.mapList(list, BeanMapper.getType(Bean1.class), BeanMapper.getType(Bean2.class));

Error stack:
java.lang.StackOverflowError: null
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)
at ma.glasnost.orika.cern.colt.map.OpenIntObjectHashMap.put(OpenIntObjectHashMap.java:329)

Can you please show Bean1 & Bean2 classes ?

Can you please show Bean1 & Bean2 classes ?

same type,same field