Skip to content

Instantly share code, notes, and snippets.

@KetothXupack
Created August 19, 2016 13:58
Show Gist options
  • Save KetothXupack/de1bf4130bfa5cb0dac9639d1b0f50f5 to your computer and use it in GitHub Desktop.
Save KetothXupack/de1bf4130bfa5cb0dac9639d1b0f50f5 to your computer and use it in GitHub Desktop.
q38969268 comment
public static Object[] lazyHtmlEscape(final String... args) {
Object[] result = new Object[args.length];
for (int i = 0; i < args.length; i++) {
result[i] = new Object {
@Override
public String toString() {
// here argument will be escaped only if
// toString method will be called
// (that happens if loglevel is enabled)
return HtmlUtil.htmlEscape(e);
}
};
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment