ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: Ant q? about core Java task: why are members private?
Date Tue, 27 Mar 2001 23:13:21 GMT
At 03:01  27/3/01 -0500, Shane_Curcuru@lotus.com wrote:
><Apologies in advance if this was an obvious question about Ant 1.3>
>
>I'm starting to implement an optional task to execute basic operations on
>other Java objects and my first thought was to simply extend the existing
>Java task, since it already has a bunch of functionality I need (classpath
>handling, basic forking, etc.).  But all the member variables there are
>private, making them inacessible to subclasses; hence I'm out of luck.
>
>A quick review of some other core taskdefs shows that some tasks declare
>everything private, some protected, and I can't figure out a particular
>difference between which kinds of tasks are which.  Why the difference?
>And why not use protected as the default for most classes?  (if you don't
>want people subclassing, then just declare yourself final, I'd think).

I would be happy to make them protected if you send the patches ;) Be
warned though that they are volatile and could change between ant versions. 

Another option is instead of reusing you actually manipulate a contained
task. This is much safer but can be extra work.


Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message