ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sayatovic, Brian" <Brian.Sayato...@divine.com>
Subject Trouble with PropertyFile
Date Tue, 28 May 2002 14:45:08 GMT
I'm getting a NullPointerException while I'm trying to update a properties file.  My best guess
is that, somehow, the 'old value' is turning out to be null, though my echos indicate that
it isn't.  Below is the snipper from my build.xml, followed by the output with th exception:

	<target name="_increment-build-number">
		<echo>Increment build number...</echo>
		<echo message="version.a=${version.a}"/>
		<echo message="version.b=${version.b}"/>
		<echo message="version.c=${version.c}"/>
		<echo message="version.d=${version.d}"/>
		<echo message="version.build=${version.build}"/>

		<propertyfile file="${version.file}" comment="Version information">
			<entry key="version.build" default="00000" type="int" operation="+" pattern="00000"/>
		</propertyfile>
	</target>

	_increment-build-number:
	     [echo] Increment build number...
	     [echo] version.a=1
	     [echo] version.b=0
	     [echo] version.c=0
	     [echo] version.d=0
	     [echo] version.build=0
	[propertyfile] Updating property file: C:\Projects\Divine\WebSelfHelp\core\CIM Components\config\build\com.divine.cim.config.version
	[propertyfile] java.lang.NullPointerException
	[propertyfile]  at java.text.DecimalFormat.parse(DecimalFormat.java:792)
	[propertyfile]  at java.text.NumberFormat.parse(NumberFormat.java:277)
	[propertyfile]  at org.apache.tools.ant.taskdefs.optional.PropertyFile$Entry.executeInteger(PropertyFile.java:441)
	[propertyfile]  at org.apache.tools.ant.taskdefs.optional.PropertyFile$Entry.executeOn(PropertyFile.java:344)
	[propertyfile]  at org.apache.tools.ant.taskdefs.optional.PropertyFile.executeOperation(PropertyFile.java:198)
	[propertyfile]  at org.apache.tools.ant.taskdefs.optional.PropertyFile.execute(PropertyFile.java:185)
	[propertyfile]  at org.apache.tools.ant.Task.perform(Task.java:313)
	[propertyfile]  at org.apache.tools.ant.Target.execute(Target.java:309)
	[propertyfile]  at org.apache.tools.ant.Target.performTasks(Target.java:334)
	[propertyfile]  at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
	[propertyfile]  at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
	[propertyfile]  at org.apache.tools.ant.Main.runBuild(Main.java:605)
	[propertyfile]  at org.apache.tools.ant.Main.start(Main.java:195)
	[propertyfile]  at org.apache.tools.ant.Main.main(Main.java:234)

Any ideas?

Regards,
Brian.

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message