Uploaded image for project: 'Commons Jelly'
  1. Commons Jelly
  2. JELLY-202

PatternSet's toString gives NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0
    • None
    • taglib.ant
    • None

    Description

      When the logging-level is set to Debug and org.apache.commons.jelly.tags.ant.AntTag is setting properties (actually, before setting the properties) on the ant-tag, the following is attempted:
      log.debug( "Setting bean property on: "+ object + " name: " + name + " value: " + value );
      which fails with a null-pointer for the following reason which I partially share:
      The toString of object is invoked and, if this one is a org.apache.tools.ant.types.PatternSet (or its inner class), it throws because the name is not set yet. It's not set yet because it's going to be set !

      I considered this as a bug, to me, toString() should never throw.
      Jelly-Ant's ant version is a bit old so I hoped a later version of Ant fixes this. By no means!
      In todays snapshot, one can see the following:
      if (name == null)

      { throw new BuildException( "Missing attribute \"name\" for a pattern"); }

      I'd propose, thus, to remove the object from the debug line above until we manage to convince anters and we upgrade.
      log.debug( "Setting bean property on name: " + name + " value: " + value );

      paul

      Attachments

        Activity

          People

            Unassigned Unassigned
            polx Paul Libbrecht
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: