ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérôme Leroux (JIRA) <j...@apache.org>
Subject [jira] [Created] (EASYANT-58) "required" attribute of path parameter is ignored
Date Fri, 06 Dec 2013 13:58:35 GMT
Jérôme Leroux created EASYANT-58:
------------------------------------

             Summary: "required" attribute of path parameter is ignored 
                 Key: EASYANT-58
                 URL: https://issues.apache.org/jira/browse/EASYANT-58
             Project: EasyAnt
          Issue Type: Bug
          Components: Core
    Affects Versions: 0.9, 0.10
            Reporter: Jérôme Leroux
            Priority: Minor


When a path parameter is declared but not required, an error is raised if it is not defined.
Example:
{{<ea:parameter path="my.path" required="false" description="Simple path" />}}

When calling easyant, the following error occurs: 
{{reference 'my.path' must be a path}}

Here is a fix to apply in execute() method of ParameterTask:
Current code:
{code:java}
if (isRequired() && p == null) {
    throw new BuildException(...);
} else if (!(p instanceof Path)) {
    throw new BuildException(...);
}
{code}

Fix:
{code:java}
if (isRequired() && p == null) {
     throw new BuildException(...);
} else if (p != null && !(p instanceof Path)) {
    throw new BuildException(...);
}
{code}




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message