ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <>
Subject Re: Multiple classes in a single file (was: Re: Can someone tell me what is so great about Ant?)
Date Wed, 07 Feb 2001 12:15:39 GMT
Frank Endriss wrote:

> You can reproduce the fault by
> -compiling
> -removing Bar.class
> -run ant: It wont compile again, since Foo.class is up to date

Yes, I know we can produce the problem in an artificial way, but I am seeing it in
real usage.

> All in all it is bad style to place more that one class in one java
> source.
> The most java-compilers do the simple check of file names. Obviously the
> name Bar.class has nothing to do with the name
> However, you can use the "depends" Property to make ant know about this
> dependency.

Sorry, I don't agree with you at all on this point.  If I have non-public classes
that are only used by the public class in the file, then it makes perfect sense to
have more than one class in a Java source file; especially when these classes are
simple.  Granted, I could make them all inner classes of the public class and that
may (or may not) solve the problem, but that seems like bad design since there is no
reason for them to be inner classes.

> Note that the problem is not "really" ant related.

It is an Ant problem if somehow Ant is causing the situation where only the public
class is being generated.  If Ant is not causing these circumstances and it is the
fault of javac, then I agree.

-> richard

View raw message