From 4ce83d5b09ec7e811cd92e4e4ccd4aeada043f0f Mon Sep 17 00:00:00 2001 From: Peter Lamby Date: Thu, 30 Jun 2022 14:58:04 +0200 Subject: [PATCH] WICKET-6993 - Get rid of unused old escape methods These are not used in the code anymore --- .../apache/wicket/resource/ResourceUtil.java | 30 ------------------- 1 file changed, 30 deletions(-) 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 ~. *