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

Jean-Noel Rouvignac
16.57.2013 92b8b0e66ec0c29c0e020c9b4aa7680ba4732f9d
Respected the Single Responsibility Principle by splitting findAndSetMatchingDN() method into findMatchedDN() and setMatchedDN() methods.

Also fixed the checkstyle error.
6 files modified
50 ■■■■ changed files
opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java 10 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendDeleteOperation.java 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java
@@ -124,7 +124,7 @@
  /** The reference to the identity mapper. */
  private IdentityMapper<?> identityMapper;
  /** The default set of supported control OIDs for this extended */
  /** The default set of supported control OIDs for this extended. */
  private Set<String> supportedControlOIDs = new HashSet<String>(0);
  /**
@@ -1242,7 +1242,7 @@
                        String.valueOf(entryDN)));
        // See if one of the entry's ancestors exists.
        findAndSetMatchingDN(operation, entryDN);
        operation.setMatchedDN(findMatchedDN(entryDN));
        return null;
      }
@@ -1264,7 +1264,7 @@
    }
  }
  private void findAndSetMatchingDN(Operation operation, DN entryDN)
  private DN findMatchedDN(DN entryDN)
  {
    try
    {
@@ -1273,8 +1273,7 @@
      {
        if (DirectoryServer.entryExists(matchedDN))
        {
          operation.setMatchedDN(matchedDN);
          return;
          return matchedDN;
        }
        matchedDN = matchedDN.getParentDNInSuffix();
@@ -1287,6 +1286,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
    }
    return null;
  }
  /**
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
@@ -347,7 +347,7 @@
        if (parentEntry == null)
        {
          findAndSetMatchingDN(parentDN);
          setMatchedDN(findMatchedDN(parentDN));
          // The parent doesn't exist, so this add can't be successful.
          setResultCode(ResultCode.NO_SUCH_OBJECT);
@@ -593,7 +593,7 @@
    }
  }
  private void findAndSetMatchingDN(DN entryDN)
  private DN findMatchedDN(DN entryDN)
  {
    try
    {
@@ -602,8 +602,7 @@
      {
        if (DirectoryServer.entryExists(matchedDN))
        {
          setMatchedDN(matchedDN);
          return;
          return matchedDN;
        }
        matchedDN = matchedDN.getParentDNInSuffix();
@@ -616,6 +615,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
    }
    return null;
  }
  private boolean checkHasReadOnlyAttributes(
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
@@ -205,7 +205,7 @@
              .valueOf(entryDN)));
          // See if one of the entry's ancestors exists.
          findAndSetMatchingDN(entryDN);
          setMatchedDN(findMatchedDN(entryDN));
          return;
        }
      }
@@ -337,7 +337,7 @@
    }
  }
  private void findAndSetMatchingDN(DN entryDN)
  private DN findMatchedDN(DN entryDN)
  {
    try
    {
@@ -346,8 +346,7 @@
      {
        if (DirectoryServer.entryExists(matchedDN))
        {
          setMatchedDN(matchedDN);
          return;
          return matchedDN;
        }
        matchedDN = matchedDN.getParentDNInSuffix();
@@ -360,6 +359,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
    }
    return null;
  }
  /**
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendDeleteOperation.java
@@ -245,7 +245,7 @@
        appendErrorMessage(ERR_DELETE_NO_SUCH_ENTRY
            .get(String.valueOf(entryDN)));
        findAndSetMatchingDN(entryDN);
        setMatchedDN(findMatchedDN(entryDN));
        return;
      }
@@ -416,7 +416,7 @@
    }
  }
  private void findAndSetMatchingDN(DN entryDN)
  private DN findMatchedDN(DN entryDN)
  {
    try
    {
@@ -425,8 +425,7 @@
      {
        if (DirectoryServer.entryExists(matchedDN))
        {
          setMatchedDN(matchedDN);
          return;
          return matchedDN;
        }
        matchedDN = matchedDN.getParentDNInSuffix();
@@ -439,6 +438,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
    }
    return null;
  }
  /**
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
@@ -383,7 +383,7 @@
      if (getOriginalEntry() == null)
      {
        // See if one of the entry's ancestors exists.
        findAndSetMatchingDN(entryDN);
        setMatchedDN(findMatchedDN(entryDN));
        setResultCode(ResultCode.NO_SUCH_OBJECT);
        appendErrorMessage(ERR_MODDN_NO_CURRENT_ENTRY.get(String
@@ -573,7 +573,7 @@
    }
  }
  private void findAndSetMatchingDN(DN entryDN)
  private DN findMatchedDN(DN entryDN)
  {
    try
    {
@@ -582,8 +582,7 @@
      {
        if (DirectoryServer.entryExists(matchedDN))
        {
          setMatchedDN(matchedDN);
          return;
          return matchedDN;
        }
        matchedDN = matchedDN.getParentDNInSuffix();
@@ -596,6 +595,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
    }
    return null;
  }
  /**
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -430,7 +430,7 @@
            .get(String.valueOf(entryDN)));
        // See if one of the entry's ancestors exists.
        findAndSetMatchingDN(entryDN);
        setMatchedDN(findMatchedDN(entryDN));
        return;
      }
@@ -629,7 +629,7 @@
    }
  }
  private void findAndSetMatchingDN(DN entryDN)
  private DN findMatchedDN(DN entryDN)
  {
    try
    {
@@ -638,8 +638,7 @@
      {
        if (DirectoryServer.entryExists(matchedDN))
        {
          setMatchedDN(matchedDN);
          return;
          return matchedDN;
        }
        matchedDN = matchedDN.getParentDNInSuffix();
@@ -652,6 +651,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
    }
    return null;
  }
  /**