Anghel Botos created MPIR-293:
---------------------------------

             Summary: On the team list report the "picUrl" property appears in 
the table, although no other properties are set for that team member
                 Key: MPIR-293
                 URL: https://jira.codehaus.org/browse/MPIR-293
             Project: Maven Project Info Reports Plugin
          Issue Type: Bug
    Affects Versions: 2.7
            Reporter: Anghel Botos
            Priority: Minor
         Attachments: HasPicUrlFix.patch

On the team list report the "picUrl" property appears in the table, although no 
other properties are set for that team member.

Given the following team list in the pom.xml:

{code:xml} 
    <developers>
        <developer>
            <id>abotos</id>
            <name>Anghel Botos</name>
            <email>[email protected]</email>
            <properties>
                <picUrl>images/avatars/abotos.png</picUrl>
            </properties>
        </developer>
    </developers>
{code} 

Due to the following lines of code in TeamListReport.java:
{code:title=TeamListReport.java|borderStyle=solid}
                Properties properties = unit.getProperties();
                boolean hasPicUrl = properties.contains( "picUrl" );
                if ( hasPicUrl )
                {
                    requiredHeaders.put( IMAGE, Boolean.TRUE );
                }
                boolean isJustAnImageProperty = properties.size() == 1 && 
hasPicUrl;
                if ( !isJustAnImageProperty && !properties.isEmpty() )
                {
                    requiredHeaders.put( PROPERTIES, Boolean.TRUE );
                }
{code} 

{{hasPicUrl}} evaluates to {{false}} because the check is done using 
{{contains}} not {{containsKey}}, and thus {{isJustAnImageProperty}} evaluates 
also to {{false}} leading to the Properties column being added to the team 
members table and the {{picUrl}} property being displayed in that column in the 
table, although the Properties column should not be present for this case.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to