You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Shatzer, Larry" <La...@Spirent.com> on 2003/09/25 22:34:35 UTC

Task getTaskType() and setTaskType()

While playing around with <script>, and looping over each target, and then
tasks, I came across an inconsistency with getTaskType() and setTaskType()
in Task.java. getTaskType() is protected, while setTaskType() is public.

Is there any reason why getTaskType() is protected?

-- Larry

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


Re: Task getTaskType() and setTaskType()

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 25 Sep 2003, Larry Shatzer <La...@spirent.com> wrote:

> Is there any reason why getTaskType() is protected?

The better question would be, is there any reason why setTaskType
isn't package private anymore.

task-type is supposed to be the name that has been used in the build
file.  task-name is generally the same but can be reset by the user
using the taskname attribute shared by all tasks.

task-type used to be package private to ensure that user's can't
fiddle with it.  Expand, the implementation of <unzip> uses this value
to print out a deprecation message even if the user does something
silly like

        <expand taskname="unzip" .../>

Costin changed it to public more than a year ago, the comment says

,----
| Allow the task type to be set from a differnet package. That elminate
| the need to have RuntimeConfigurable2 in the same package.
`----

Given that there is no RuntimeConfigurable2 anymore, I'm not sure
whether it really still needs to be public at all.  If it remains
public, the getter should become public as well, I agree.

Stefan

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