ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49400] New: Log statements in AbstractFileset can cause NullPointerExceptions
Date Mon, 07 Jun 2010 20:07:03 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49400

           Summary: Log statements in AbstractFileset can cause
                    NullPointerExceptions
           Product: Ant
           Version: 1.8.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: gavares@gmail.com


I use the tasks defined in Apache Ant programatically to perform simple unix
tasks such as deleting directories, untarring files, etc. When using these
tasks in this fashion, I do not create instances of Project to pass to the
classes.

Recently, after using the Delete class successfully some time, I began calling:

    delete.setFollowSymlinks(false)

and started seeing NPE's after calling delete.execute(). Stacktrace:

Caused by: java.lang.NullPointerException
    at
org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:464)
    at
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:430)
    at org.apache.tools.ant.types.FileSet.size(FileSet.java:82)
    at
org.apache.tools.ant.types.resources.Resources$MyCollection.<init>(Resources.java:74)
    at
org.apache.tools.ant.types.resources.Resources.validate(Resources.java:229)
    at
org.apache.tools.ant.types.resources.Resources.isFilesystemOnly(Resources.java:162)
    at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:587)


This was run using ant version 1.7.0. Looking into the source code for
AbstractFileSet, line 464 is:

            p.log(getDataTypeName() + ": Setup scanner in dir " + dir 
            + " with " + ps, Project.MSG_DEBUG);


It seems like project is null at this line when the log statement is called.
This problem does not occur if I do not call setFollowSymlinks.

This line corresponds with line 520 of AbstractFileSet in version 1.8.1.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message