From 54cf10644f43ffc2c909ec06e83fc159eb0ee65d Mon Sep 17 00:00:00 2001 From: "Neil A. Wilson" Date: Thu, 5 Dec 2019 09:35:26 -0600 Subject: [PATCH] Fix a searchrate NPE with no base DN or LDAP URL Fixed an issue that prevented the searchrate tool from running if neither a base DN pattern nor an LDAP URL pattern was provided. --- docs/release-notes.html | 6 ++++++ src/com/unboundid/ldap/sdk/examples/SearchRate.java | 6 +++++- .../com/unboundid/ldap/sdk/examples/SearchRateTestCase.java | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.html b/docs/release-notes.html index 5e8fd351d..2aaa443bb 100644 --- a/docs/release-notes.html +++ b/docs/release-notes.html @@ -21,6 +21,12 @@

Version 4.0.14



+
  • + Fixed an issue that prevented the searchrate tool from running if neither a base + DN pattern nor an LDAP URL pattern was provided. +

    +
  • +
  • Added a new FullLDAPInterface interface that extends LDAPInterface and adds support for close, bind, and diff --git a/src/com/unboundid/ldap/sdk/examples/SearchRate.java b/src/com/unboundid/ldap/sdk/examples/SearchRate.java index 2ab788b35..ec1705481 100644 --- a/src/com/unboundid/ldap/sdk/examples/SearchRate.java +++ b/src/com/unboundid/ldap/sdk/examples/SearchRate.java @@ -922,10 +922,14 @@ public ResultCode doToolProcessing() { dnPattern = new ValuePattern(baseDN.getValue(), seed); } - else + else if (ldapURL.isPresent()) { dnPattern = null; } + else + { + dnPattern = new ValuePattern("", seed); + } } catch (final ParseException pe) { diff --git a/tests/unit/src/com/unboundid/ldap/sdk/examples/SearchRateTestCase.java b/tests/unit/src/com/unboundid/ldap/sdk/examples/SearchRateTestCase.java index 968272252..0b229a922 100644 --- a/tests/unit/src/com/unboundid/ldap/sdk/examples/SearchRateTestCase.java +++ b/tests/unit/src/com/unboundid/ldap/sdk/examples/SearchRateTestCase.java @@ -235,7 +235,6 @@ public void testMultipleEntriesByFilterNormalOutput() "-p", String.valueOf(getTestPort()), "-D", getTestBindDN(), "-w", getTestBindPassword(), - "-b", getTestBaseDN(), "-s", "sub", "-f", "(uid=user.[1-10])", "-t", "10",