Source:
@Override public boolean matchesSource(@Nonnull Origin origin, @Nonnull URI resource) { if (origin instanceof GUID) { if (this.isWildcard()) { return resource.isNetworkScheme() || (origin).equals(resource.scheme); } } else if (!(origin instanceof SchemeHostPortTriple)) { return false; } SchemeHostPortTriple shpOrigin = (SchemeHostPortTriple) origin; if (this.isWildcard()) { return resource.isNetworkScheme() || shpOrigin.scheme.matches(resource.scheme); } boolean schemeMatches; if (this.scheme == null) { schemeMatches = resource.scheme.equalsIgnoreCase("http") ? shpOrigin.scheme.equalsIgnoreCase("http") || shpOrigin.scheme.equalsIgnoreCase("https") : resource.scheme.equalsIgnoreCase(shpOrigin.scheme); } else { schemeMatches = this.scheme.equalsIgnoreCase(resource.scheme); } boolean hostMatches = this.host.equals("*") || (this.host.startsWith("*.") ? resource.host.toLowerCase().endsWith(this.host.substring(1).toLowerCase()) : this.host.equalsIgnoreCase(resource.host)); boolean uriUsesDefaultPort = resource.port == Constants.EMPTY_PORT || SchemeHostPortTriple.defaultPortForProtocol(resource.scheme) == resource.port; boolean thisUsesDefaultPort = this.scheme != null && (this.port == Constants.EMPTY_PORT || SchemeHostPortTriple.defaultPortForProtocol(this.scheme) == this.port); boolean portMatches = this.port == Constants.WILDCARD_PORT || (this.port == Constants.EMPTY_PORT ? uriUsesDefaultPort : (resource.port == Constants.EMPTY_PORT ? thisUsesDefaultPort : this.port == resource.port)); boolean pathMatches = this.path == null || (this.path.endsWith("/") ? resource.path.startsWith(this.path) : this.path.equals(resource.path)); return schemeMatches && hostMatches && portMatches && pathMatches; }

Target:
@Override public boolean matchesSource(@Nonnull Origin origin, @Nonnull URI resource) { if (origin instanceof GUID) { return this.isWildcard() && resource.isNetworkScheme(); } else if (!(origin instanceof SchemeHostPortTriple)) { return false; } SchemeHostPortTriple shpOrigin = (SchemeHostPortTriple) origin; if (this.isWildcard()) { return resource.isNetworkScheme() || shpOrigin.scheme.matches(resource.scheme); } boolean schemeMatches; if (this.scheme == null) { schemeMatches = resource.scheme.equalsIgnoreCase("http") ? shpOrigin.scheme.equalsIgnoreCase("http") || shpOrigin.scheme.equalsIgnoreCase("https") : resource.scheme.equalsIgnoreCase(shpOrigin.scheme); } else { schemeMatches = this.scheme.equalsIgnoreCase(resource.scheme); } boolean hostMatches = this.host.equals("*") || (this.host.startsWith("*.") ? resource.host.toLowerCase().endsWith(this.host.substring(1).toLowerCase()) : this.host.equalsIgnoreCase(resource.host)); boolean uriUsesDefaultPort = resource.port == Constants.EMPTY_PORT || SchemeHostPortTriple.defaultPortForProtocol(resource.scheme) == resource.port; boolean thisUsesDefaultPort = this.scheme != null && (this.port == Constants.EMPTY_PORT || SchemeHostPortTriple.defaultPortForProtocol(this.scheme) == this.port); boolean portMatches = this.port == Constants.WILDCARD_PORT || (this.port == Constants.EMPTY_PORT ? uriUsesDefaultPort : (resource.port == Constants.EMPTY_PORT ? thisUsesDefaultPort : this.port == resource.port)); boolean pathMatches = this.path == null || (this.path.endsWith("/") ? resource.path.startsWith(this.path) : this.path.equals(resource.path)); return schemeMatches && hostMatches && portMatches && pathMatches; }