Skip to content

Commit 7ebb24c

Browse files
author
Peter Lamby
committed
WICKET-6993 - Get rid of unused old escape methods
These are not used in the code anymore
1 parent 09b5cf9 commit 7ebb24c

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

wicket-core/src/main/java/org/apache/wicket/resource/ResourceUtil.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.nio.charset.Charset;
2222
import java.util.ArrayList;
2323
import java.util.Locale;
24-
import java.util.regex.Pattern;
2524

2625
import org.apache.wicket.WicketRuntimeException;
2726
import org.apache.wicket.request.Url;
@@ -44,7 +43,6 @@ public class ResourceUtil
4443
* Used to denote {@code null} in encoded strings.
4544
*/
4645
private static final String NULL_VALUE = "null";
47-
private static final Pattern ESCAPED_ATTRIBUTE_PATTERN = Pattern.compile("(\\w)~(\\w)");
4846

4947
/**
5048
* Reads resource reference attributes (style, locale, variation) encoded in the given string.
@@ -138,20 +136,6 @@ public static void encodeResourceReferenceAttributes(Url url, ResourceReference
138136
}
139137
}
140138

141-
/**
142-
* Escapes any occurrences of <em>-</em> character in the style and variation
143-
* attributes with <em>~</em>. Any occurrence of <em>~</em> is encoded as <em>~~</em>.
144-
*
145-
* @param attribute
146-
* the attribute to escape
147-
* @return the attribute with escaped separator character
148-
*/
149-
public static CharSequence escapeAttributesSeparator(String attribute)
150-
{
151-
CharSequence tmp = Strings.replaceAll(attribute, "~", "~~");
152-
return Strings.replaceAll(tmp, "-", "~");
153-
}
154-
155139
/**
156140
* Parses the string representation of a {@link java.util.Locale} (for example 'en_GB').
157141
*
@@ -241,20 +225,6 @@ public static String readString(IResourceStream resourceStream, Charset charset)
241225
}
242226
}
243227

244-
/**
245-
* Reverts the escaping applied by {@linkplain #escapeAttributesSeparator(String)} - unescapes
246-
* occurrences of <em>~</em> character in the style and variation attributes with <em>-</em>.
247-
*
248-
* @param attribute
249-
* the attribute to unescape
250-
* @return the attribute with escaped separator character
251-
*/
252-
public static String unescapeAttributesSeparator(String attribute)
253-
{
254-
String tmp = ESCAPED_ATTRIBUTE_PATTERN.matcher(attribute).replaceAll("$1-$2");
255-
return Strings.replaceAll(tmp, "~~", "~").toString();
256-
}
257-
258228
/**
259229
* Encode the {@code part} in the format <string length encoded in base ten ASCII>~<string data>.
260230
*

0 commit comments

Comments
 (0)