Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2668

PlainPasswordPrincipalDatabase - code improvement

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6, 0.7
    • Fix Version/s: 0.7
    • Component/s: Broker-J
    • Labels:
      None

      Description

      This snippet:
      try
      {
      try
      {
      _userUpdate.lock();
      char[] orig = user.getPassword();
      user.setPassword(password);

      try

      { savePasswordFile(); }

      catch (IOException e)

      { _logger.error("Unable to save password file, password change for user '" + principal + "' discarded"); //revert the password change user.setPassword(orig); return false; }

      return true;
      }
      finally
      {
      if (_userUpdate.isHeldByCurrentThread())

      { _userUpdate.unlock(); }

      }
      }
      catch (Exception e)

      { return false; }

      is flagged by our Sonar server. This patch will streamline the code.

        Attachments

          Activity

            People

            • Assignee:
              gemmellr Robbie Gemmell
              Reporter:
              sorins Sorin Suciu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: