Source:
private Block transform(XDOM macroXDOM, boolean async, boolean cached) throws RenderingException { WikiMacroBinding macroBinding = createBinding(async); Block block; XDOM xdom; try { Block syncMetaDataBlock; if (async) { block = macroXDOM; xdom = macroXDOM; syncMetaDataBlock = null; } else { MacroBlock wikiMacroBlock = this.syncContext.getCurrentMacroBlock(); MacroMarkerBlock wikiMacroMarker = new MacroMarkerBlock(wikiMacroBlock.getId(), wikiMacroBlock.getParameters(), wikiMacroBlock.getContent(), macroXDOM.getChildren(), wikiMacroBlock.isInline()); syncMetaDataBlock = new MetaDataBlock(Collections.<Block>singletonList(wikiMacroMarker), macroXDOM.getMetaData()); wikiMacroBlock.getParent().replaceChild(syncMetaDataBlock, wikiMacroBlock); wikiMacroBlock.setParent(syncMetaDataBlock.getParent()); wikiMacroBlock.setNextSiblingBlock(syncMetaDataBlock.getNextSibling()); wikiMacroBlock.setPreviousSiblingBlock(syncMetaDataBlock.getPreviousSibling()); block = wikiMacroMarker; xdom = this.syncContext.getXDOM(); } try { this.observation.notify(STARTEXECUTION_EVENT, this.wikimacro, macroBinding); block = transform(block, xdom, macroBinding, async); } finally { if (syncMetaDataBlock != null) { syncMetaDataBlock.getParent().replaceChild(this.syncContext.getCurrentMacroBlock(), syncMetaDataBlock); } this.observation.notify(ENDEXECUTION_EVENT, this.wikimacro); } } catch (Exception ex) { throw new RenderingException("Error while performing internal macro transformations", ex); } finally { restoreBindingsOrClean(); } this.macroContent = macroBinding.getContent(); block = resolveMacroPlaceholders(block); cleanMacroMarkers(block); if (async || cached) { try ( AutoCloseable closable = this.authorExecutor.before(this.sourceAuthorReference, this.sourceReference)) { transform(block, xdom, async); } catch (Exception e) { throw new RenderingException("Error while performing transformations of resolved", e); } } return block; }

Target:
private Block transform(XDOM macroXDOM, boolean async, boolean cached) throws RenderingException { WikiMacroBinding macroBinding = createBinding(async); Block block; XDOM xdom; try { Block syncMetaDataBlock; if (async) { block = macroXDOM; xdom = macroXDOM; syncMetaDataBlock = null; } else { MacroBlock wikiMacroBlock = this.syncContext.getCurrentMacroBlock(); MacroMarkerBlock wikiMacroMarker = new MacroMarkerBlock(wikiMacroBlock.getId(), wikiMacroBlock.getParameters(), wikiMacroBlock.getContent(), macroXDOM.getChildren(), wikiMacroBlock.isInline()); syncMetaDataBlock = new MetaDataBlock(Collections.<Block>singletonList(wikiMacroMarker), macroXDOM.getMetaData()); wikiMacroBlock.getParent().replaceChild(syncMetaDataBlock, wikiMacroBlock); wikiMacroBlock.setParent(syncMetaDataBlock.getParent()); wikiMacroBlock.setNextSiblingBlock(syncMetaDataBlock.getNextSibling()); wikiMacroBlock.setPreviousSiblingBlock(syncMetaDataBlock.getPreviousSibling()); block = wikiMacroMarker; xdom = this.syncContext.getXDOM(); } try { this.observation.notify(STARTEXECUTION_EVENT, this.wikimacro, macroBinding); block = transform(block, xdom, macroBinding, async); } finally { if (syncMetaDataBlock != null) { syncMetaDataBlock.getParent().replaceChild(this.syncContext.getCurrentMacroBlock(), syncMetaDataBlock); } this.observation.notify(ENDEXECUTION_EVENT, this.wikimacro); } } catch (Exception ex) { throw new RenderingException("Error while performing internal macro transformations", ex); } finally { restoreBindingsOrClean(); } block = resolveMacroPlaceholders(block); cleanMacroMarkers(block); if (async || cached) { try ( AutoCloseable closable = this.authorExecutor.before(this.sourceAuthorReference, this.sourceReference)) { transform(block, xdom, async); } catch (Exception e) { throw new RenderingException("Error while performing transformations of resolved", e); } } return block; }