Use a private static final instead of an ivar.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1147501 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
12f8a472c0
commit
fe645ed552
|
@ -201,7 +201,7 @@ public void testEscapeEcmaScript() {
|
||||||
// HTML and XML
|
// HTML and XML
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
String[][] htmlEscapes = {
|
private static final String[][] HTML_ESCAPES = {
|
||||||
{"no escaping", "plain text", "plain text"},
|
{"no escaping", "plain text", "plain text"},
|
||||||
{"no escaping", "plain text", "plain text"},
|
{"no escaping", "plain text", "plain text"},
|
||||||
{"empty string", "", ""},
|
{"empty string", "", ""},
|
||||||
|
@ -217,10 +217,10 @@ public void testEscapeEcmaScript() {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEscapeHtml() {
|
public void testEscapeHtml() {
|
||||||
for (int i = 0; i < htmlEscapes.length; ++i) {
|
for (int i = 0; i < HTML_ESCAPES.length; ++i) {
|
||||||
String message = htmlEscapes[i][0];
|
String message = HTML_ESCAPES[i][0];
|
||||||
String expected = htmlEscapes[i][1];
|
String expected = HTML_ESCAPES[i][1];
|
||||||
String original = htmlEscapes[i][2];
|
String original = HTML_ESCAPES[i][2];
|
||||||
assertEquals(message, expected, StringEscapeUtils.escapeHtml4(original));
|
assertEquals(message, expected, StringEscapeUtils.escapeHtml4(original));
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
try {
|
try {
|
||||||
|
@ -234,10 +234,10 @@ public void testEscapeHtml() {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnescapeHtml4() {
|
public void testUnescapeHtml4() {
|
||||||
for (int i = 0; i < htmlEscapes.length; ++i) {
|
for (int i = 0; i < HTML_ESCAPES.length; ++i) {
|
||||||
String message = htmlEscapes[i][0];
|
String message = HTML_ESCAPES[i][0];
|
||||||
String expected = htmlEscapes[i][2];
|
String expected = HTML_ESCAPES[i][2];
|
||||||
String original = htmlEscapes[i][1];
|
String original = HTML_ESCAPES[i][1];
|
||||||
assertEquals(message, expected, StringEscapeUtils.unescapeHtml4(original));
|
assertEquals(message, expected, StringEscapeUtils.unescapeHtml4(original));
|
||||||
|
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
|
|
Loading…
Reference in New Issue