Ivy
  1. Ivy
  2. IVY-87

static reference to ant project in fr.jayasoft.ivy.util.Message causes NullPointerException in environments like netbeans

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3-RC1
    • Component/s: Ant, Core
    • Labels:
      None
    • Environment:

      Windows XP, Java 1.5, NetBeans 4.1 (5.0 beta), Ant 1.6.5

      Description

      i'am using ivy 1.2a with netbeans. Running the buildlist task works fine for the first time but after run once the task causes a NullPointerException.

      The reason is the following snippet from fr.jayasoft.ivy.ant.IvyTask:

      protected void ensureMessageInitialised() {
      if (!Message.isInitialised())

      { Message.init(new AntMessageImpl(getProject())); }

      }

      NetBeans starts Ant always within the same VM and fr.jayasoft.ivy.util.Message references statically an "old" Ant project. No buildlisteners are registered to the "old" project object anymore and so a call Project.log causes a NullPointerException.

      Please remove this static dependency because NetBeans + Ivy is really cool - when it works...

        Activity

        Keil Marx created issue -
        Hide
        Xavier Hanin added a comment -

        removed the reuse of the project instance, now message is reconfigured for each task. I hope this will work fine in netbeans (please keep me informed, you can test it by building ivy yourself from source or by downloading the latest version fixing this which should be uploaded tonight).

        Show
        Xavier Hanin added a comment - removed the reuse of the project instance, now message is reconfigured for each task. I hope this will work fine in netbeans (please keep me informed, you can test it by building ivy yourself from source or by downloading the latest version fixing this which should be uploaded tonight).
        Hide
        Jesse Glick added a comment -

        I can verify that with my test setup as described in

        http://www.netbeans.org/issues/show_bug.cgi?id=69727

        using NB 5.0 RC2 (which does not contain the workaround mentioned in that report), the NPE occurs with Ivy 1.2a but not with 1.3 RC1. So you may consider this fix verified as far as I am concerned. (Sorry for not verifying earlier, I was too busy...)

        Show
        Jesse Glick added a comment - I can verify that with my test setup as described in http://www.netbeans.org/issues/show_bug.cgi?id=69727 using NB 5.0 RC2 (which does not contain the workaround mentioned in that report), the NPE occurs with Ivy 1.2a but not with 1.3 RC1. So you may consider this fix verified as far as I am concerned. (Sorry for not verifying earlier, I was too busy...)
        Jeff Turner made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Xavier Hanin
            Reporter:
            Keil Marx
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development