BAEL-7629: Update article "Circular Dependencies in Spring" (#16166)

This commit is contained in:
ACHRAF TAITAI 2024-03-19 22:55:11 +01:00 committed by GitHub
parent 9ba4572686
commit 9c2a26d4e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package com.baeldung.circulardependency;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@Component
@ -11,7 +12,7 @@ public class CircularDependencyB {
private String message = "Hi!";
@Autowired
public void setCircA(final CircularDependencyA circA) {
public void setCircA(@Lazy final CircularDependencyA circA) {
this.circA = circA;
}