Bug 50179 - Properties declared as "local" are not accessible via propertyset
Summary: Properties declared as "local" are not accessible via propertyset
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.2
Hardware: PC Windows XP
: P1 blocker (vote)
Target Milestone: 1.10.9
Assignee: Ant Notifications List
Depends on:
Reported: 2010-10-29 04:11 UTC by Isaac Shabtay
Modified: 2020-08-11 13:31 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Isaac Shabtay 2010-10-29 04:11:19 UTC
Run this:

<?xml version="1.0" encoding="UTF-8"?>
<project name="test">
	<target name="tst">
		<local name="loc"/>
		<property name="loc" value="hello"/>
				<propertyref name="loc"/>

You'd expect the property "loc" to be printed, but it doesn't.
Comment-out the "local" task and it will work as expected.

I'd consider setting severity here to "criticial" as it indeed looks like something insanely bad.
Comment 1 Daniel Reilly 2017-09-19 17:09:22 UTC
Anyone looking at this?  It looks like it has been out there for 7 years and it is still not fixed.
Comment 2 Jaikiran Pai 2017-09-27 04:14:26 UTC
I don't have the complete knowledge about the expected semantics of the propertyset task, however its documentation here[1] states:

>> Selects properties from the current project to be included in the set.

So it seems to be meant to only include the properties that are at project level and the "local" task just creates properties that are local to that block, so I don't think this current behaviour is a bug. But like I said, I don't have much background knowledge about the semantics of this task

[1] https://ant.apache.org/manual/Types/propertyset.html
Comment 3 Daniel Reilly 2017-09-28 18:57:44 UTC
Local properties are supposed to work like regular properties, except that they disappear at the end of the block.  So, why wouldn't propertyset take them into account?
Comment 4 Stefan Bodewig 2020-08-11 13:31:14 UTC
fixed via https://github.com/apache/ant/pull/135