Created
August 19, 2016 13:58
-
-
Save KetothXupack/de1bf4130bfa5cb0dac9639d1b0f50f5 to your computer and use it in GitHub Desktop.
q38969268 comment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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