
Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
On Fri, 04 Nov 2005 08:49:00 +0000, Thomas Hawtin
<usenet@tackline.plus.com> wrote, quoted or indirectly quoted someone
who said :
>>>when saving the file that contains the source code of class Example
>>>why should we give the name of the file as same as the name of the
[quoted text clipped - 6 lines]
>And so that us humans stand a chance of finding the right file (in a
>sensible period of time and with minimal effort).
one thing I find odd is that package scope classes can piggyback on
the source code of a public class. There is no easy way for javac to
find them. It must go looking in all the *.java classes in a package
directory.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Ross Bamford - 04 Nov 2005 10:28 GMT
> On Fri, 04 Nov 2005 08:49:00 +0000, Thomas Hawtin
> <usenet@tackline.plus.com> wrote, quoted or indirectly quoted someone
[quoted text clipped - 15 lines]
> find them. It must go looking in all the *.java classes in a package
> directory.
I believe that it uses the name of the classes anyway - if you compile a
source file with three classes, two non-public obviously, you get three,
properly named class files. I expect it builds up that mapping first, and
then uses that from there.
AFAIR even 'back in the day' the source naming thing was motivated more by
consistency and readability (and maybe an easier time for implementors)
than the need for javac to find sources.

Signature
Ross Bamford - rosco@roscopeco.remove.co.uk
Luc The Perverse - 05 Nov 2005 01:09 GMT
>> On Fri, 04 Nov 2005 08:49:00 +0000, Thomas Hawtin
>> <usenet@tackline.plus.com> wrote, quoted or indirectly quoted someone
[quoted text clipped - 24 lines]
> consistency and readability (and maybe an easier time for implementors)
> than the need for javac to find sources.
Absolutely. This was a deliberately introduced system to encourage better
styles of organization.
--
LTP
:)
Thomas Hawtin - 05 Nov 2005 04:27 GMT
>>>one thing I find odd is that package scope classes can piggyback on
>>>the source code of a public class. There is no easy way for javac to
>>>find them. It must go looking in all the *.java classes in a package
>>>directory.
> Absolutely. This was a deliberately introduced system to encourage better
> styles of organization.
Come to think of it, allowing package private outer classes made more
sense in JDK 1.00. With no nested classes, every class was an outer
class. If you had lots of small classes involved with a single class
implementation then there could have been huge numbers of tiny files,
mostly consisting of import statements.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Luc The Perverse - 05 Nov 2005 06:48 GMT
> Come to think of it, allowing package private outer classes made more
> sense in JDK 1.00. With no nested classes, every class was an outer class.
> If you had lots of small classes involved with a single class
> implementation then there could have been huge numbers of tiny files,
> mostly consisting of import statements.
You are not implying that that is better though?
--
LTP
:)
What? in a sensible period of time with minimal effort?
oh right this isnt C ;)