mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
09.00.2016 8de5b2eff206a39d408f149cecc29607ffa62846
DN.java: Added precisions about localName(int) vs. parent(int)
1 files modified
8 ■■■■■ changed files
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java
@@ -736,12 +736,16 @@
     * dn.localName(dn.size()).equals(dn);
     * </pre>
     *
     * Said otherwise, a new DN is built using {@code index} RDNs,
     * retained in the same order, starting from the left.
     *
     * @param index
     *            The number of RDNs to be included in the local name.
     * @return The DN whose content is the specified number of RDNs from this
     *         DN.
     * @throws IllegalArgumentException
     *             If {@code index} is less than zero.
     * @see #parent(int) for the reverse operation (starting from the right)
     */
    public DN localName(final int index) {
        Reject.ifFalse(index >= 0, "index less than zero");
@@ -786,6 +790,9 @@
     * RDNs removed. Note that if {@code index} is zero then this DN will be
     * returned (identity).
     *
     * Said otherwise, a new DN is built using {@code index} RDNs,
     * retained in the same order, starting from the right.
     *
     * @param index
     *            The number of RDNs to be removed.
     * @return The DN which is equal to this DN with the specified number of
@@ -793,6 +800,7 @@
     *         reached.
     * @throws IllegalArgumentException
     *             If {@code index} is less than zero.
     * @see #localName(int) for the reverse operation (starting from the left)
     */
    public DN parent(final int index) {
        // We allow size + 1 so that we can return null as the parent of the