Bug 53626 - Applying expandproperties to an empty file raises NullPointerException
Summary: Applying expandproperties to an empty file raises NullPointerException
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.8.4
Hardware: All All
: P2 normal (vote)
Target Milestone: 1.9.0
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-30 23:12 UTC by erickson_d
Modified: 2012-08-13 05:46 UTC (History)
0 users



Attachments
A sample build file that serves as a test case for the bug. (403 bytes, text/xml)
2012-07-30 23:12 UTC, erickson_d
Details

Note You need to log in before you can comment on or make changes to this bug.
Description erickson_d 2012-07-30 23:12:05 UTC
Created attachment 29141 [details]
A sample build file that serves as a test case for the bug.

When expandproperties is used in a filterchain that is applied to an empty file, a NullPointerException is thrown from ExpandProperties:

BUILD FAILED
/home/erickson/foo/build.xml:7: java.lang.NullPointerException
	at org.apache.tools.ant.filters.ExpandProperties.read(ExpandProperties.java:110)

The bug was introduced in /ant/core/trunk/src/main/org/apache/tools/ant/filters/ExpandProperties.java revision 1090431. The result of ParseProperties.parseProperties(String) may be null. This result must be checked for null before invoking toString() on it.

This bug is not present in 1.8.2. It is present in 1.8.3 and 1.8.4.
Comment 1 Stefan Bodewig 2012-08-13 05:46:17 UTC
fixed with svn revision 1372266

Thanks!