Any existing way to make sure beans defined in spring xml has no status?

Working on a large project, we started using spring to manage our dependency injection. Since most developers are migrated from a state-encoded class, we found that some of the idle beans actually contain instance variables, which are states themselves.

Correct me if I'm wrong it shouldn't be too hard to write a unit test to make sure that all the idle bean defined in spring xml actually have no state (i.e. bean should not have any instance variable that was never defined in spring xml). Before I try to write one, ask yourself, is there any existing tool to verify this?

thank

+3
source share
1 answer

spring . / , - beans. , ;)

+1

Source: https://habr.com/ru/post/1725397/


All Articles