Reputation: 335
From the doc page: Note: To properly nest multiple overridings, subclasses should generally invoke super.afterExecute at the beginning of this method.
If I had a chain of subclasses of ThreadPoolExecutor, each with an afterExecute override, putting the super.afterExecute will ensure that each afterExecute override in its respective subclass will run?
Since the original afterExecute method in ThreadPoolExecutor is empty, putting super.afterExecute in the first subclass doesn't do anything useful?
Upvotes: 1
Views: 526
Reputation: 425073
Maybe, but there are situations where you could cause you problems if you do not call super.afterExecute()
, because your code will still run, but the Executor may not function properly if:
Not being thorough is like a ticking time bomb that may explode one day, and it will be much harder to find the bug later on.
Upvotes: 2