Uploaded image for project: 'Maven Project Info Reports Plugin'
  1. Maven Project Info Reports Plugin
  2. MPIR-293

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7
    • 2.8
    • None
    • None
    • Patch

    Description

      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:

       
          <developers>
              <developer>
                  <id>abotos</id>
                  <name>Anghel Botos</name>
                  <email>anghel.botos@someemailprovider.com</email>
                  <properties>
                      <picUrl>images/avatars/abotos.png</picUrl>
                  </properties>
              </developer>
          </developers>
      

      Due to the following lines of code in TeamListReport.java:

      TeamListReport.java
                      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 );
                      }
      

      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.

      Attachments

        1. HasPicUrlFix.patch
          0.8 kB
          Anghel Botos

        Issue Links

          Activity

            People

              stephenconnolly stephenconnolly
              abotos Anghel Botos
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: