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'm experiencing what seems to be a spring 4.0 bug related to the new feature "Autowiring of Generic Types".
Getting a java.lang.StackOverflowError when trying to inject a generic dao:
public interface StockMovementDao<S extends StockMovement>
the important is in the following two lines:
public interface StockMovement<P extends StockMovementInstruction>
public interface StockMovementInstruction<C extends StockMovement>
Please note that one uses the other as generic parameter - StockMovement uses StockMovementInstruction and StockMovementInstruction the StockMovement.
Because of that org.springframework.core.ResolvableType.isAssignableFrom(ResolvableType.java:259) is called for one then for the other infinitely till a StackOverflowError.
I guess that to fix this bug, A.isAssignableFrom(B) -> B.isAssignableFrom(A) cases should be detected. I might be wrong, but in these cases it should probably return true.