Closed hduelme closed 8 months ago
@filiphr the null return of createRemoveMappersFix
could still happen.
For example:
@Mapper(componentModel = "spring")
abstract class WrongComponentModelMapper {
static {
Mappers.getMapper(WrongComponentModelMapper.class);
}
Target map(Target source);
}
or
@Mapper(config = MyConfig.class, componentModel = "spring")
interface WrongComponentModelMapper {
WrongComponentModelMapper INSTANCE = () -> {
return Mappers.getMapper(WrongComponentModelMapper.class);
};
Target map(Target source);
}
No variable to delete but the inspection still shows up. Or while typing. This would cause a plugin crash if we don't check.
Alternatively we could change the behavior to always return the delete Option.
OK gotcha, I believe that this would have been a problem with the current version already. I don't think that we took such use cases into consideration.
I think that we can do this step by step.
What do you think @hduelme?
@filiphr Yes, we should solve it step by step. There should be no possible crashes in this version. So I would leaf it as it is for now. Would you open a issue for step 2?
Would you open a issue for step 2?
Yup, I've opened #183 for this.
I'll proceed with merging this one
@filiphr I found a working solution for #155 I used the
SafeDeleteFix
to delete the instance unlike my solution in #176 it checks for usage.