You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2020/08/04 10:29:01 UTC
[Bug 64643] New: PropertyFile Task operation can not handle int
bigger than 999
https://bz.apache.org/bugzilla/show_bug.cgi?id=64643
Bug ID: 64643
Summary: PropertyFile Task operation can not handle int bigger
than 999
Product: Ant
Version: 1.10.5
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Optional Tasks
Assignee: notifications@ant.apache.org
Reporter: vasilev@gmail.com
Target Milestone: ---
Having a simple script that increments build number on each execution :
<?xml version="1.0"?>
<project default="createBuildNumber" basedir=".">
<target name = "createBuildNumber">
<propertyfile file="build.number">
<entry key="build_number" type="int" operation="+"
value="1"/>
</propertyfile>
</target>
</project>
When number reaches 999 in the property file, the next one is not a number but
a String like this one : build_number=1\u00a0000
Best Regards,
Veselin
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 64643] PropertyFile Task operation can not handle int bigger
than 999
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64643
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from Stefan Bodewig <bo...@apache.org> ---
Propertyfile formats the number according to your default DecimalFormat unless
you specify the pattern attribute. \u00a0 is a non breaking space, which I've
never seen in a DecimalFormat but maybe expected in your locale.
It should work if you specify pattern="####" or even more hashes.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 64643] PropertyFile Task operation can not handle int bigger
than 999
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64643
Veselin Vasilev <va...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #4 from Veselin Vasilev <va...@gmail.com> ---
Thanks Stefan,
that explains it.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 64643] PropertyFile Task operation can not handle int bigger
than 999
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64643
--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
If you omit the pattern Ant uses "new DecimalFormat()" which uses the decimal
format for your locale (the FORMAT one
https://docs.oracle.com/javase/8/docs/api/java/util/Locale.Category.html#FORMAT
to be precise). It is very common for the locale specific format to contain a
thousands-separator which in a German locale 1000 would be formatted as 1.000
for example.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 64643] PropertyFile Task operation can not handle int bigger
than 999
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64643
--- Comment #2 from Veselin Vasilev <va...@gmail.com> ---
Thanks Stefan,
hashes pattern help and it works by using it.
My locales are
System Locale: bg;Bulgarian
Input Locale: en-us;English (United States)
But I still do not get it why it starts to behave like that when the number
exceeds 3 digits. It works fine with int's < 999
Best Regards,
Veselin
--
You are receiving this mail because:
You are the assignee for the bug.