-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
When using subclass mappings the method itself is accepted as a possible conversion method.
This is not wanted, work around is to manually define the subclass mapping methods.
Reproduction scenario:
class Animal {
String name;
}
class Dog extends Animal {
String race;
}
class Cat extends Animal {
String race;
}
class TargetAnimal {
String name;
String race;
}
@SubclassMapping( target = TargetAnimal.class, source = Dog.class )
@SubclassMapping( target = TargetAnimal.class, source = Cat.class )
TargetAnimal map(Animal source);
What happends is that the TargetAnimal map(Animal) method is called for each subclass, instead of new methods being generated.
The following 2 methods are wanted here:
TargetAnimal map(Dog dog);
TargetAnimal map(Cat cat);
Work-around is to create these 2 mapping methods manually.