You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@archiva.apache.org by "JC (JIRA)" <ji...@apache.org> on 2017/04/18 20:20:41 UTC

[jira] [Created] (MRM-1938) Condition that always returns true

JC created MRM-1938:
-----------------------

             Summary: Condition that always returns true
                 Key: MRM-1938
                 URL: https://issues.apache.org/jira/browse/MRM-1938
             Project: Archiva
          Issue Type: Bug
            Reporter: JC


Hi

In a recent snapshot mirrored from Github for archiva-redback-core, I've found following suspicious code in redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/user/LdapUserMapper.java.

{code}
156         if ( !StringUtils.isEmpty( user.getFullName() ) )
157         {
158             if ( user.getFullName() == null )
159             {
160                 addAttrs.put( getUserFullNameAttribute(), user.getFullName() );
161             }
162             else if ( !user.getFullName().equals( user.getFullName() ) )
163             {
164                 modAttrs.put( getUserFullNameAttribute(), user.getFullName() );
165             }
166         }
167 
168         if ( !StringUtils.isEmpty( user.getEmail() ) )
169         {
170             if ( user.getEmail() == null )
171             {
172                 addAttrs.put( getEmailAddressAttribute(), user.getEmail() );
173             }
174             else if ( !user.getEmail().equals( user.getEmail() ) )
175             {
176                 modAttrs.put( getEmailAddressAttribute(), user.getEmail() );
177             }
178         }
{code}
In Line 162, and 174, the conditions should be 
user.getFullName().equals( fullNameAttribute )
user.getEmail().equals( emailAttribute )
respectively?

This might not be an issue, but wanted to report just in case. Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)