Bird
0
0

What will happen if the Around advice method forgets to call pjp.proceed()?

medium📝 Predict Output Q5 of 15
Spring Boot - Aspect-Oriented Programming
What will happen if the Around advice method forgets to call pjp.proceed()?
AAn exception is thrown automatically
BThe target method executes twice
CThe target method will not execute
DThe advice is ignored
Step-by-Step Solution
Solution:
  1. Step 1: Understand pjp.proceed() role

    Calling pjp.proceed() runs the original method inside Around advice.
  2. Step 2: Consequence of missing proceed call

    If proceed() is not called, the original method never runs.
  3. Final Answer:

    The target method will not execute -> Option C
  4. Quick Check:

    Missing proceed() = no method execution [OK]
Quick Trick: Always call pjp.proceed() to run the target method [OK]
Common Mistakes:
  • Assuming method runs automatically without proceed()
  • Expecting exceptions without explicit throw
  • Thinking advice is skipped if proceed() missing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes