You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find a place to submit issues on the GitHub page, so I'll have to do it
here. I'm using 1.4.5.
I have a list of Enum Values (Strings) in one class and I want to map them to a
list of Enums in another class.
What steps will reproduce the problem?
1. Create an enum called EnumTest, add "foo" and "bar" as enums.
2. Create a class called Class A, add List<String> enumTest as a property
3. Create an instance of Class A, add String values for "foo" and "bar" to
enumTest.
4. Create a class called Class B, add List<EnumTest> enumTest as a property
5. Attempt to map an instance of Class A to Class B them with orika (without a
custom converter):
mapperFactory.registerClassMap(mapperFactory.classMap(A.class,
B.class).byDefault().toClassMap())
What is the expected output? What do you see instead?
I expect it to map without an issue. Instead, I get this error:
Error: java.lang.ClassCastException: EnumTest cannot be cast to java.lang.String
ma.glasnost.orika.MappingException: java.lang.ClassCastException:
com.commercehub.eeprom.restservice.model.awareness.NotificationFrequency cannot
be cast to java.lang.String
at ma.glasnost.orika.impl.ExceptionUtility.newMappingException(ExceptionUtility.java:55) ~[orika-core-1.4.5.jar:na]
at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:273) ~[orika-core-1.4.5.jar:na]
at ma.glasnost.orika.impl.MapperFacadeImpl.mapElement(MapperFacadeImpl.java:861) ~[orika-core-1.4.5.jar:na]
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsCollection(MapperFacadeImpl.java:686) ~[orika-core-1.4.5.jar:na]
at ma.glasnost.orika.impl.MapperFacadeImpl.mapAsSet(MapperFacadeImpl.java:425) ~[orika-core-1.4.5.jar:na]
at ma.glasnost.orika.generated.Orika_AwarenessConfiguration_AwarenessConfiguration_Mapper25487564015555$5.mapAtoB(Orika_AwarenessConfiguration_AwarenessConfiguration_Mapper25487564015555$5.java) ~[na:na]
at ma.glasnost.orika.impl.mapping.strategy.UseCustomMapperStrategy.map(UseCustomMapperStrategy.java:67) ~[orika-core-1.4.5.jar:na]
at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:263) ~[orika-core-1.4.5.jar:na]
What version of the product are you using? On what operating system?
1.4.5
Please provide any additional information below.
Original issue reported on code.google.com by [email protected] on 16 Dec 2014 at 8:49
The text was updated successfully, but these errors were encountered:
Eh, well, I attempted to manually replace my classes with EnumTest in the error
message. Didn't work out so well. I can provide further documentation if needed.
Original issue reported on code.google.com by
[email protected]
on 16 Dec 2014 at 8:49The text was updated successfully, but these errors were encountered: