You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Matt Benson <gu...@gmail.com> on 2010/02/18 19:27:26 UTC
BZ 48768: Properties wrongly read from file or not update during read
Convenience link: https://issues.apache.org/bugzilla/show_bug.cgi?
id=48768
This problem happens in src/main/org/apache/tools/ant/property/
ResolvePropertyMap.java . Peter, you extracted this class some two
years ago, but at the point in the code at which the offense takes
place, there is the comment:
// Note: the master overrides (even if the name is subsequently
// prefixed)
I realize it's been awhile, but due to there being a comment to the
effect that this behavior is intentional, do you have any
recollection of why this was necessary? The behavior reported in BZ
does seem counter-intuitive and wrong. Is there some rationalization
for why the behavior is correct that I am not grasping?
Thanks,
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during
read
Posted by Peter Reilly <pe...@gmail.com>.
I think that we will just have to put the old code (1.7) back in.
Peter
On Wed, Feb 24, 2010 at 4:10 PM, Stefan Bodewig <bo...@apache.org> wrote:
> On 2010-02-18, Matt Benson <gu...@gmail.com> wrote:
>
>> This problem happens in src/main/org/apache/tools/ant/property/
>> ResolvePropertyMap.java . Peter, you extracted this class some two
>> years ago, but at the point in the code at which the offense takes
>> place, there is the comment:
>
>> // Note: the master overrides (even if the name is subsequently
>> // prefixed)
>
> If you trace it back to the older code you'll see it corresponds to a
> check whether the property is defined outside of the map as well - and
> if it is use the outside value - to enforce property immutability.
>
> To account for the bug report it may be a good idea to ignore existing
> properties only if we are importing with a prefix. This does require
> adding a new overload with a prefix argument, but it's the only way we
> can re-gain the old behavior for property files AFAICS.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during
read
Posted by Peter Reilly <pe...@gmail.com>.
Great news.
Peter
On Wed, Feb 24, 2010 at 4:22 PM, Stefan Bodewig <bo...@apache.org> wrote:
> On 2010-02-24, Stefan Bodewig <bo...@apache.org> wrote:
>
>> To account for the bug report it may be a good idea to ignore existing
>> properties only if we are importing with a prefix.
>
> and look for an existing property with the prefix when using one.
>
> I have a modified version that passes the testcase I've added for 48768
> and a new one I've written for the "Gump is broken" scenario and will
> commit it as soon as it has completed the full test suite (about fifteen
> minutes from now).
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during read
Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-02-24, Stefan Bodewig <bo...@apache.org> wrote:
> To account for the bug report it may be a good idea to ignore existing
> properties only if we are importing with a prefix.
and look for an existing property with the prefix when using one.
I have a modified version that passes the testcase I've added for 48768
and a new one I've written for the "Gump is broken" scenario and will
commit it as soon as it has completed the full test suite (about fifteen
minutes from now).
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during read
Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-02-18, Matt Benson <gu...@gmail.com> wrote:
> This problem happens in src/main/org/apache/tools/ant/property/
> ResolvePropertyMap.java . Peter, you extracted this class some two
> years ago, but at the point in the code at which the offense takes
> place, there is the comment:
> // Note: the master overrides (even if the name is subsequently
> // prefixed)
If you trace it back to the older code you'll see it corresponds to a
check whether the property is defined outside of the map as well - and
if it is use the outside value - to enforce property immutability.
To account for the bug report it may be a good idea to ignore existing
properties only if we are importing with a prefix. This does require
adding a new overload with a prefix argument, but it's the only way we
can re-gain the old behavior for property files AFAICS.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during read
Posted by Matt Benson <gu...@gmail.com>.
Thanks for looking into this one, Peter. -Matt
On Feb 22, 2010, at 9:24 AM, Peter Reilly wrote:
> I think that I was trying to allow the map to be used in a stack
> of property maps. But looking at the original code
> for Property in 1.7, I got it wrong, so I have removed
> the test.
>
> Peter
>
> On Fri, Feb 19, 2010 at 2:57 PM, Peter Reilly
> <pe...@gmail.com> wrote:
>> Looks like a bad bug.
>>
>> Will have a look during the weekend.
>>
>> Peter
>>
>>
>> On Thu, Feb 18, 2010 at 8:33 PM, Antoine Levy-Lambert
>> <an...@gmx.de> wrote:
>>> Hello Matt,
>>>
>>>> Datum: Thu, 18 Feb 2010 12:27:26 -0600
>>>> Von: Matt Benson <gu...@gmail.com>
>>>> An: Ant Developers List <de...@ant.apache.org>
>>>
>>>> Convenience link:
>>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=48768
>>>>
>>>> The behavior reported in BZ
>>>> does seem counter-intuitive and wrong.
>>>
>>> Agreed.
>>>
>>>> Thanks,
>>>> Matt
>>>>
>>> Antoine
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: dev-help@ant.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during
read
Posted by Peter Reilly <pe...@gmail.com>.
I think that I was trying to allow the map to be used in a stack
of property maps. But looking at the original code
for Property in 1.7, I got it wrong, so I have removed
the test.
Peter
On Fri, Feb 19, 2010 at 2:57 PM, Peter Reilly
<pe...@gmail.com> wrote:
> Looks like a bad bug.
>
> Will have a look during the weekend.
>
> Peter
>
>
> On Thu, Feb 18, 2010 at 8:33 PM, Antoine Levy-Lambert <an...@gmx.de> wrote:
>> Hello Matt,
>>
>>> Datum: Thu, 18 Feb 2010 12:27:26 -0600
>>> Von: Matt Benson <gu...@gmail.com>
>>> An: Ant Developers List <de...@ant.apache.org>
>>
>>> Convenience link:
>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=48768
>>>
>>> The behavior reported in BZ
>>> does seem counter-intuitive and wrong.
>>
>> Agreed.
>>
>>> Thanks,
>>> Matt
>>>
>> Antoine
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during
read
Posted by Peter Reilly <pe...@gmail.com>.
Looks like a bad bug.
Will have a look during the weekend.
Peter
On Thu, Feb 18, 2010 at 8:33 PM, Antoine Levy-Lambert <an...@gmx.de> wrote:
> Hello Matt,
>
>> Datum: Thu, 18 Feb 2010 12:27:26 -0600
>> Von: Matt Benson <gu...@gmail.com>
>> An: Ant Developers List <de...@ant.apache.org>
>
>> Convenience link:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=48768
>>
>> The behavior reported in BZ
>> does seem counter-intuitive and wrong.
>
> Agreed.
>
>> Thanks,
>> Matt
>>
> Antoine
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: BZ 48768: Properties wrongly read from file or not update during
read
Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Matt,
> Datum: Thu, 18 Feb 2010 12:27:26 -0600
> Von: Matt Benson <gu...@gmail.com>
> An: Ant Developers List <de...@ant.apache.org>
> Convenience link:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=48768
>
> The behavior reported in BZ
> does seem counter-intuitive and wrong.
Agreed.
> Thanks,
> Matt
>
Antoine
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org