diff --git a/wicket-core/src/main/java/org/apache/wicket/resource/ResourceUtil.java b/wicket-core/src/main/java/org/apache/wicket/resource/ResourceUtil.java index 2d52811db3..51c93e1ac2 100644 --- a/wicket-core/src/main/java/org/apache/wicket/resource/ResourceUtil.java +++ b/wicket-core/src/main/java/org/apache/wicket/resource/ResourceUtil.java @@ -21,7 +21,6 @@ import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Locale; -import java.util.regex.Pattern; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.request.Url; @@ -44,7 +43,6 @@ public class ResourceUtil * Used to denote {@code null} in encoded strings. */ private static final String NULL_VALUE = "null"; - private static final Pattern ESCAPED_ATTRIBUTE_PATTERN = Pattern.compile("(\\w)~(\\w)"); /** * Reads resource reference attributes (style, locale, variation) encoded in the given string. @@ -138,20 +136,6 @@ public static void encodeResourceReferenceAttributes(Url url, ResourceReference } } - /** - * Escapes any occurrences of - character in the style and variation - * attributes with ~. Any occurrence of ~ is encoded as ~~. - * - * @param attribute - * the attribute to escape - * @return the attribute with escaped separator character - */ - public static CharSequence escapeAttributesSeparator(String attribute) - { - CharSequence tmp = Strings.replaceAll(attribute, "~", "~~"); - return Strings.replaceAll(tmp, "-", "~"); - } - /** * Parses the string representation of a {@link java.util.Locale} (for example 'en_GB'). * @@ -241,20 +225,6 @@ public static String readString(IResourceStream resourceStream, Charset charset) } } - /** - * Reverts the escaping applied by {@linkplain #escapeAttributesSeparator(String)} - unescapes - * occurrences of ~ character in the style and variation attributes with -. - * - * @param attribute - * the attribute to unescape - * @return the attribute with escaped separator character - */ - public static String unescapeAttributesSeparator(String attribute) - { - String tmp = ESCAPED_ATTRIBUTE_PATTERN.matcher(attribute).replaceAll("$1-$2"); - return Strings.replaceAll(tmp, "~~", "~").toString(); - } - /** * Encode the {@code part} in the format ~. *