Consider the following file:
class MyPackageClass { ... }
public class MyPublicClass { ... }
DrJava's automatic filename logic merely finds the
first top-level class declaration, so this file would
have its filename suggested as MyPackageClass, even
though javac would require it to be named
MyPublicClass. Ideally, we should determine the
correct public top-level classname if one exists,
defaulting to a package-private class only if no public
class exists.
That said, this is an extremely silly case. Anyone who
writes a public class _after_ a package-private class
in a file can deal with typing the filename in
manually, I think, so it only really matters for a
sense of consistency with Java's rules.