8273484: Cleanup unnecessary null comparison before instanceof check in java.naming

Reviewed-by: aefimov, dfuchs
This commit is contained in:
Andrey Turbanov 2021-09-12 13:48:24 +00:00 committed by Aleksei Efimov
parent f189dff5cb
commit 2ee1f96c14
13 changed files with 33 additions and 44 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -198,8 +198,8 @@ final class LdapReferralContext implements DirContext, LdapContext {
void setHopCount(int hopCount) {
this.hopCount = hopCount;
if ((refCtx != null) && (refCtx instanceof LdapCtx)) {
((LdapCtx)refCtx).setHopCount(hopCount);
if (refCtx instanceof LdapCtx ldapCtx) {
ldapCtx.setHopCount(hopCount);
}
}