Integrate and tweak http://issues.apache.org/bugzilla/show_bug.cgi?id=35588. Next: Try and replace VariableFormatter.Token with java.text.FieldPosition.