[ 
https://issues.apache.org/jira/browse/QPID-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894323#action_12894323
 ] 

Andrew Kennedy commented on QPID-2668:
--------------------------------------

Applied patch and committed

> PlainPasswordPrincipalDatabase - code improvement 
> --------------------------------------------------
>
>                 Key: QPID-2668
>                 URL: https://issues.apache.org/jira/browse/QPID-2668
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: 0.6, 0.7
>            Reporter: Sorin Suciu
>            Priority: Minor
>             Fix For: 0.7
>
>         Attachments: qpid-2668.patch
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to