Search code examples
javadozer

Object Mapping Error - Java


I am trying to perform custom dozer mapping and see the below error -

Expected : class [Lcom.customer.types.WorkListDetails;, Actual : class com.customer.types.WorkListDetails

The class name seems to be the same but I don't understand what [L is.


Solution

  • The class names are not the same; the code is expecting an array of WorkListDetails instances, but you are providing only a single instance. The [ part means that the type is an array. The L specifies a class (and will end in a ;). In this case, it specifies the type of the array.