SeataAutoDataSourceProxyCreator's override about AbstractAutoProxyCreator#wrapIfNecessary is unnecessary and non-compliant
PleaseGiveMeTheCoke opened this issue · comments
The AbstractAutoProxyCreator's wrapIfNecessary method does not expect to be overridden by subclasses, whereas getAdvicesAndAdvisorsForBean and shouldSkip expect to be overridden by subclasses even more.
The logic of SeataAutoDataSourceProxyCreator's override of wrapIfNecessary can be done entirely in getAdvicesAndAdvisorsForBean and shouldSkip.
For example, the logic in the red box below can be done entirely in shouldSkip
Meanwhile, the following logic for SeataDataSourceProxy creation can be done entirely in getAdvicesAndAdvisorsForBean, passing the created proxy to SeataAutoDataSourceProxyAdvice via the constructor
This also means that the existence of the DataSourceProxyHolder is unnecessary