Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-3
    • Fix Version/s: 2.0
    • Component/s: announcement
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      3

      Description

      When calling mvn changes:announcement-generate for the attached changes.xml VTL errors are logged due to the various null fields in the Action bean:

      [INFO] [changes:announcement-generate]
      [INFO] Creating announcement file from changes.xml...
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 30, column 1]
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 31, column 1]
      [ERROR] Left side ($!issue) of '!=' operation has null value. Operation not possible. org/apache/maven/plugin/announcement/announcement.vm [line 32, column 27]
      [ERROR] Left side ($!dueto) of '!=' operation has null value. Operation not possible. org/apache/maven/plugin/announcement/announcement.vm [line 32, column 65]
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 43, column 1]
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 44, column 1]
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 56, column 1]
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 57, column 1]
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 69, column 1]
      [ERROR] RHS of #set statement is null. Context will not be modified. org/apache/maven/plugin/announcement/announcement.vm [line 70, column 1]
      [INFO] File created...
      

      The attached patch goes the hard way and improves the VTL template to check for nulls. Easier would be to establish an invariant for the bean properties stating that they are never null but maybe empty, i.e. change all the setters to convert null into an empty string.

      1. changes.xml
        0.8 kB
        Benjamin Bentmann
      2. vtl-errors.patch
        3 kB
        Benjamin Bentmann

        Activity

        Benjamin Bentmann made changes -
        Field Original Value New Value
        Attachment MCHANGES-97.zip [ 32318 ]
        Dennis Lundberg made changes -
        Fix Version/s 2.0-beta-4 [ 13722 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Dennis Lundberg [ dennislundberg ]

          People

          • Assignee:
            Dennis Lundberg
            Reporter:
            Benjamin Bentmann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: