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

Ludovic Poitou
21.44.2011 76b96928a3b704a542482c63b93927ff449b1b5f
Code cleanup removing potential issues detected by FindBugs
3 files modified
40 ■■■■■ changed files
opends/src/server/org/opends/server/util/args/ArgumentParser.java 10 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java 10 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java 20 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/args/ArgumentParser.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.server.util.args;
import org.opends.messages.Message;
@@ -577,7 +578,7 @@
  /**
   * Adds the provided argument to the set of arguments handled by this parser
   * and puts the arguement in the general group.
   * and puts the argument in the general group.
   *
   * @param  argument  The argument to be added.
   *
@@ -613,9 +614,9 @@
      throw new ArgumentException(message);
    }
    if (versionArgument != null)
    if ((versionArgument != null) && (shortID != null))
    {
      if (shortID == versionArgument.getShortIdentifier())
      if (shortID.equals(versionArgument.getShortIdentifier()))
      {
        // Update the version argument to not display its short identifier.
        try {
@@ -1401,7 +1402,8 @@
    {
      if (trailingArgsDisplayName == null)
      {
        buffer.append(" "+INFO_ARGPARSER_USAGE_TRAILINGARGS.get());
        buffer.append(" ");
        buffer.append(INFO_ARGPARSER_USAGE_TRAILINGARGS.get());
      }
      else
      {
opends/src/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.server.util.cli;
@@ -1150,7 +1151,14 @@
      copySecureArgsList.keyStorePathArg.addValue(keystorePath);
      commandBuilder.addArgument(copySecureArgsList.keyStorePathArg);
    }
    else
    {
      // KeystorePath is null. Either it's unspecified or there's a pb
      // We should throw an exception here, anyway since code below will
      // anyway
      throw ArgumentExceptionFactory
          .incompatiblePropertyModification("null keystorePath");
    }
    // Then the keystore password.
    keystorePassword = secureArgsList.keyStorePasswordArg.getValue();
opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2010 ForgeRock AS
 *      Portions Copyright 2010-2011 ForgeRock AS
 */
package org.opends.server.workflowelement.externalchangelog;
@@ -608,13 +608,10 @@
    // Start a specific ECL session
    eclSession = replicationServer.createECLSession(startECLSessionMsg);
    if (true)
    {
      // Loop on result entries
      int INITIAL=0;
      int PSEARCH=1;
      int phase=INITIAL;
    int phase = 0; // 0 is initial phase, 1 is psearch
      boolean returnedRoot = false;
      while (true)
      {
        // Check for a request to cancel this operation.
@@ -628,7 +625,7 @@
            returnRootEntryIfRequired(true);
            returnedRoot = true;
          }
          if (phase==INITIAL)
        if (phase == 0)
          {
            if (!buildAndReturnEntry(update))
            {
@@ -645,7 +642,7 @@
            returnRootEntryIfRequired(false);
            returnedRoot = true;
          }
          if (phase==INITIAL)
        if (phase == 0)
          {
            if (this.persistentSearch == null)
            {
@@ -654,14 +651,13 @@
            }
            else
            {
              phase=PSEARCH;
            phase = 1;
              break;
            }
          }
        }
      }
    }
  }
  private void returnRootEntryIfRequired(boolean hasSubordinates)
  throws DirectoryException
@@ -1535,6 +1531,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public CancelResult cancel(CancelRequest cancelRequest)
  {
    if (debugEnabled())
@@ -1553,6 +1550,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void abort(CancelRequest cancelRequest)
  {
    if (debugEnabled())
@@ -1580,7 +1578,7 @@
  {
    //  the conversion from one unique identifier to an other is
    //  a question of formating : the last "-" is placed
    StringBuffer buffer = new StringBuffer(entryUid);
    StringBuilder buffer = new StringBuilder(entryUid);
    //  Delete a "-" at 13 to get something like
    buffer.deleteCharAt(13);