Extension statements have the ugly property of being potentially recursive:
module foobar { prefix fb; extension foo { fb:bar; } extension bar { fb:foo; } }
Here in order to create effective statements for either foo or bar, we need the other effective statement first – leading to the typical chicken-and-egg problem.
Our current implementation deals with this problem by using a thread-local object leaker and relies on the constructors invoking StmtContext.buildEffective().
In order to reign in object lifecycle, we need to eliminate this assumption, so that we do not require leaking an unconstructed object.
Refactor current implementation to use BaseStatementSupport and provide correct lifecycle hooks so that we realize when we are headed towards recursive creation. Escape from it by creating placeholder objects, which will have their details filled in afterwards (such as substatements).
- blocks
-
YANGTOOLS-1121 Cleanup AbstractStatementSupport implementation
- Resolved
- relates to
-
YANGTOOLS-1065 Minimize EffectiveStatement implementation footprint
- Resolved