RFR: 8265426: Update java.security to use instanceof pattern variable

Roger Riggs rriggs at openjdk.java.net
Mon Apr 26 18:26:44 UTC 2021


On Mon, 26 Apr 2021 08:50:36 GMT, Patrick Concannon <pconcannon at openjdk.org> wrote:

> Hi,
> 
> Could someone please review my code for updating the code in the `java.security` package to make use of the `instanceof` pattern variable?
> 
> Kind regards,
> Patrick

Marked as reviewed by rriggs (Reviewer).

src/java.base/share/classes/java/security/CodeSource.java line 174:

> 172:         // certs must match
> 173:         return matchCerts(other, true);
> 174:     }

Can this (160-173) be collapsed to:

return (obj instanceof CodeSource cs) && Objects.equals(location, other.location) && matchCerts(cs, true)

-------------

PR: https://git.openjdk.java.net/jdk/pull/3687


More information about the security-dev mailing list