As explained by S3749, spring classes are singleton by default, but @Scope annotation can change this behavior. From the documentation:
As a rule of thumb, you should use the prototype scope for all beans that are stateful
In addition, you can define a custom scope, that could also change it.
We should therefore report an issue only when the scope is known, and not "prototype".
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @Scope("prototype") @Scope(value = "prototype") @Scope("custom-scope")
Note: S3750 already detect @Scope annotations.
- relates to
-
RSPEC-3749 Members of Spring components should be injected
- Active
- links to