Suggested by Tim Ellison. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@473415 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -16,6 +16,9 @@ Fixed bugs: | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| * Warn user when a reference in the form "${refid}" cannot be resolved as this | |||||
| is a sign they probably meant "refid" (misuse of property expansion syntax). | |||||
| Changes from Ant 1.7.0Beta3 to Ant 1.7.0RC1 | Changes from Ant 1.7.0Beta3 to Ant 1.7.0RC1 | ||||
| =========================================== | =========================================== | ||||
| @@ -1911,7 +1911,18 @@ public class Project implements ResourceFactory { | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| // Check for old id behaviour | // Check for old id behaviour | ||||
| return resolveIdReference(key, this); | |||||
| ret = resolveIdReference(key, this); | |||||
| if (ret == null && !key.equals(MagicNames.REFID_PROPERTY_HELPER)) { | |||||
| Vector p = new Vector(); | |||||
| PropertyHelper.getPropertyHelper(this).parsePropertyString( | |||||
| key, new Vector(), p); | |||||
| if (p.size() == 1) { | |||||
| log("Unresolvable reference " + key | |||||
| + " might be a misuse of property expansion syntax.", | |||||
| MSG_WARN); | |||||
| } | |||||
| } | |||||
| return ret; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -0,0 +1,9 @@ | |||||
| <project xmlns:au="antlib:org.apache.ant.antunit"> | |||||
| <target name="testIt"> | |||||
| <au:expectfailure> | |||||
| <pathconvert refid="${foo}" /> | |||||
| </au:expectfailure> | |||||
| <au:assertLogContains level="warning" | |||||
| text="Unresolvable reference $${foo} might be a misuse of property expansion syntax." /> | |||||
| </target> | |||||
| </project> | |||||