
boolean thisUsesDefaultPort = this.scheme != null && (this.port.isEmpty() || Origin.defaultPortForProtocol(this.scheme).equals(this.port));
</BUG>
boolean portMatches =
<BUG>this.port.equals("*") || (
this.port.isEmpty()
? uriUsesDefaultPort
: (uri.port.isEmpty() ? thisUsesDefaultPort : this.port.equals(uri.port))
);</BUG>
boolean pathMatches = this.path == null || this.path.matches(uri.path);

: this.scheme.equalsIgnoreCase(uri.scheme);
boolean hostMatches =
this.host.equals("*") || (this.host.startsWith("*.")
? uri.host.endsWith(this.host.substring(2))
: this.host.equalsIgnoreCase(uri.host));
boolean uriUsesDefaultPort = uri.port == Constants.EMPTY_PORT || Origin.defaultPortForProtocol(uri.scheme) == uri.port;
boolean thisUsesDefaultPort = this.scheme != null && (this.port == Constants.EMPTY_PORT || Origin.defaultPortForProtocol(this.scheme) == this.port);
boolean portMatches =
this.port == Constants.WILDCARD_PORT || (
this.port == Constants.EMPTY_PORT
? uriUsesDefaultPort
: (uri.port == Constants.EMPTY_PORT ? thisUsesDefaultPort : this.port == uri.port)
);
boolean pathMatches = this.path == null || this.path.matches(uri.path);
