void () { final Runnable action = () -> { IntList indices = initEmptyVariables(); getSegments().setSegmentsGreedy(false); LOG.assertTrue(myTemplateRange.isValid(), "template key: " + getTemplate().getKey() + "; " + "template text: " + getTemplate().getTemplateText() + "; " + "variable number: " + getCurrentVariableNumber()); reformat(); getSegments().setSegmentsGreedy(true); restoreEmptyVariables(indices); }; performWrite(action); }