Affects: main
@Nullable
private Advice instantiatedAdvice;
@Override
public synchronized Advice getAdvice() {
if (this.instantiatedAdvice == null) {
this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut);
}
return this.instantiatedAdvice;
}
I think getAdvice() method can be used to double-check lock, please give me more advice, thanks.
Comment From: snicoll
Thanks for the suggestion but the method is synchronized
, so there's no need for a double-check lock.