Qpid
  1. Qpid
  2. QPID-2668

PlainPasswordPrincipalDatabase - code improvement

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6, 0.7
    • Fix Version/s: 0.7
    • Component/s: Java Broker
    • 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.

        Activity

        Hide
        Sorin Suciu added a comment -

        Please apply on the trunk

        Show
        Sorin Suciu added a comment - Please apply on the trunk
        Hide
        Andrew Kennedy added a comment -

        Applied patch and committed

        Show
        Andrew Kennedy added a comment - Applied patch and committed
        Hide
        Robbie Gemmell added a comment -

        Resolving issue for Andrew (as he still hasnt got his JIRA rights)

        Show
        Robbie Gemmell added a comment - Resolving issue for Andrew (as he still hasnt got his JIRA rights)

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development