ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <jesse.gl...@sun.com>
Subject Re: svn commit: r420305 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition: ConditionBase.java HasMethod.java
Date Wed, 26 Jul 2006 21:12:57 GMT
stevel@apache.org wrote:
> well, if you put the docs in, you need to follow with the code. <hasMethod> looks
for methods.

Wouldn't hasMember be more appropriate since it can check for fields too?

> URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasMethod.java?rev=420305&view=auto
> +        if (method!=null) {
> +            return isMethodFound(clazz);
> +        }
> +        if(field!=null) {
> +            return isFieldFound(clazz);
> +        }
> +        throw new BuildException("Neither method nor field defined");

Should probably also throw BuildException in case both are defined, 
since it seems the intention is that one or the other should be.

BTW I notice that this condition cannot check for either constructors or 
method overloads. Maybe no one cares.

-J.

-- 
jesse.glick@sun.com  x22801  netbeans.org  ant.apache.org
       http://google.com/search?q=e%5E%28pi*i%29%2B1


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message