From ef64b3c004c437201a3e3cea6ecde9a0274cb07d Mon Sep 17 00:00:00 2001 From: HÃ¥kon Hallingstad Date: Tue, 15 Feb 2022 14:35:34 +0100 Subject: Remove priority from UriPattern --- .../com/yahoo/jdisc/application/UriPattern.java | 33 ---------------------- 1 file changed, 33 deletions(-) (limited to 'jdisc_core/src/main') diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/application/UriPattern.java b/jdisc_core/src/main/java/com/yahoo/jdisc/application/UriPattern.java index 4d9a843b8fb..1ddf91aee2b 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/application/UriPattern.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/application/UriPattern.java @@ -29,7 +29,6 @@ import java.util.regex.Pattern; */ public class UriPattern implements Comparable { - public static final int DEFAULT_PRIORITY = 0; private static final Pattern PATTERN = Pattern.compile("([^:]+)://([^:/]+)(:((\\*)|([0-9]+)))?/(.*)", Pattern.UNICODE_CASE | Pattern.CANON_EQ); private final String pattern; @@ -38,9 +37,6 @@ public class UriPattern implements Comparable { private final int port; private final GlobPattern path; - // TODO Vespa 8 jonmv remove - private final int priority; - /** *

Creates a new instance of this class that represents the given pattern string, with a priority of 0. * The input string must be on the form <scheme>://<host>[:<port>]<path>, where @@ -59,31 +55,6 @@ public class UriPattern implements Comparable { port = parseOrZero(matcher.group(4)); path = GlobPattern.compile(nonNullOrWildcard(matcher.group(7))); pattern = scheme + "://" + host + ":" + (port > 0 ? port : "*") + "/" + path; - this.priority = DEFAULT_PRIORITY; - } - - /** - *

Creates a new instance of this class that represents the given pattern string, with the given priority. The - * input string must be on the form <scheme>://<host>[:<port>]<path>, where - * '*' can be used as a wildcard character at any position.

- * - * @deprecated Use {@link #UriPattern(String)} and let's avoid another complication here. - * @param uri The pattern to parse. - * @param priority The priority of this pattern. - * @throws IllegalArgumentException If the pattern could not be parsed. - */ - @Deprecated(forRemoval = true, since = "7") - public UriPattern(String uri, int priority) { - Matcher matcher = PATTERN.matcher(uri); - if (!matcher.find()) { - throw new IllegalArgumentException(uri); - } - scheme = GlobPattern.compile(normalizeScheme(nonNullOrWildcard(matcher.group(1)))); - host = GlobPattern.compile(nonNullOrWildcard(matcher.group(2))); - port = parseOrZero(matcher.group(4)); - path = GlobPattern.compile(nonNullOrWildcard(matcher.group(7))); - pattern = scheme + "://" + host + ":" + (port > 0 ? port : "*") + "/" + path; - this.priority = priority; } /** @@ -135,10 +106,6 @@ public class UriPattern implements Comparable { @Override public int compareTo(UriPattern rhs) { int cmp; - cmp = rhs.priority - priority; - if (cmp != 0) { - return cmp; - } cmp = scheme.compareTo(rhs.scheme); if (cmp != 0) { return cmp; -- cgit v1.2.3