8149450: LdapCtx.processReturnCode() throwing Null Pointer Exception
Reviewed-by: xuelei
This commit is contained in:
parent
2929c453fb
commit
3ee9a50b6f
@ -2978,7 +2978,8 @@ final public class LdapCtx extends ComponentDirContext
|
|||||||
r = new LdapReferralException(resolvedName, resolvedObj, remainName,
|
r = new LdapReferralException(resolvedName, resolvedObj, remainName,
|
||||||
msg, envprops, fullDN, handleReferrals, reqCtls);
|
msg, envprops, fullDN, handleReferrals, reqCtls);
|
||||||
// only one set of URLs is present
|
// only one set of URLs is present
|
||||||
r.setReferralInfo(res.referrals.elementAt(0), false);
|
r.setReferralInfo(res.referrals == null ? null :
|
||||||
|
res.referrals.elementAt(0), false);
|
||||||
|
|
||||||
if (hopCount > 1) {
|
if (hopCount > 1) {
|
||||||
r.setHopCount(hopCount);
|
r.setHopCount(hopCount);
|
||||||
@ -3047,7 +3048,7 @@ final public class LdapCtx extends ComponentDirContext
|
|||||||
* assume name resolution has not yet completed.
|
* assume name resolution has not yet completed.
|
||||||
*/
|
*/
|
||||||
if (((res.entries == null) || (res.entries.isEmpty())) &&
|
if (((res.entries == null) || (res.entries.isEmpty())) &&
|
||||||
(res.referrals.size() == 1)) {
|
((res.referrals != null) && (res.referrals.size() == 1))) {
|
||||||
|
|
||||||
r.setReferralInfo(res.referrals, false);
|
r.setReferralInfo(res.referrals, false);
|
||||||
|
|
||||||
|
@ -217,13 +217,15 @@ final public class LdapReferralException extends
|
|||||||
System.out.println("LdapReferralException.setReferralInfo");
|
System.out.println("LdapReferralException.setReferralInfo");
|
||||||
|
|
||||||
this.referrals = referrals;
|
this.referrals = referrals;
|
||||||
if (referrals != null) {
|
referralCount = (referrals == null) ? 0 : referrals.size();
|
||||||
referralCount = referrals.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
for (int i = 0; i < referralCount; i++) {
|
if (referrals != null) {
|
||||||
System.out.println(" [" + i + "] " + referrals.elementAt(i));
|
for (int i = 0; i < referralCount; i++) {
|
||||||
|
System.out.println(" [" + i + "] " + referrals.elementAt(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("setReferralInfo : referrals == null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user