- final StmtContext<QName,ExtensionStatement, EffectiveStatement<QName,ExtensionStatement>> ctx) {
- Set<StmtContext<?, ?, ?>> building = BUILDING.get();
- if (building == null) {
- building = new HashSet<>();
- BUILDING.set(building);
+ final StmtContext<QName,ExtensionStatement ,EffectiveStatement<QName,ExtensionStatement>> ctx) {
+
+ // Look at the thread-local leak in case we are invoked recursively
+ final ExtensionEffectiveStatementImpl existing = RecursiveObjectLeaker.lookup(ctx,
+ ExtensionEffectiveStatementImpl.class);
+ if (existing != null) {
+ // Careful! this not fully initialized!
+ return existing;