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

Punikekk github.com+50504152+punikekk at openjdk.java.net
Tue Apr 27 04:44:40 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

src/java.base/share/classes/java/security/Identity.java line 345:

> 343:             if (this.fullName().equals(other.fullName())) {
> 344:                 return true;
> 345:             } else {

Suggestion:

src/java.base/share/classes/java/security/Identity.java line 349:

> 347:             }
> 348:         }
> 349:         return false;

Suggestion:

        return obj instanceof Identity other
                && (this.fullName().equals(other.fullName())
                || identityEquals(other));

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

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



More information about the security-dev mailing list