On 4/05/2011 9:25 a.m., [email protected] wrote:
I was looking at the source code for jdk7 and I noticed that they were
using the old convention of using package.html instead of the
suggested method of using package-info.java (in JDK 5).

Is this just a simple case of "do as I say and not as I do" or has
this method been rethought?
I doubt there has been a reversion of thought back to package.html.

It probably depends on whether the package itself is new in JDK7. Generally new conventions don't cause the whole codebase to be rewritten according to the convention. It is more of a slow migration as other things need changing in each file, appropriate new conventions are applied.

So for old packages, I'd expect them to still be in package.html (unless an annotation was added to the package declaration - then I'd expect it to be converted to package-info.java). However for new packages, it should probably be in package-info.java, and if not, there is probably legitimate grounds for grumbling.

So are you referring to pre java 6 packages (since this is actually a java 6 feature) or packages new in java 6 or 7?

Bruce



From: 
http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#packagecomment

Package Comment Files

Each package can have its own documentation comment, contained in its
own "source" file, that the Javadoc tool will merge into the package
summary page that it generates. You typically include in this comment
any documentation that applies to the entire package.

To create a package comment file, you have a choice of two files to
place your comments:

     package-info.java - Can contain a package declaration, package
annotations, package comments and Javadoc tags. This file is new in
JDK 5.0, and is preferred over package.html.
     package.html - Can contain only package comments and Javadoc tags,
no package annotations.

A package may have a single package.html file or a single package-
info.java file but not both. Place either file in the package
directory in the source tree along with your .java files.


--
You received this message because you are subscribed to the Google Groups "The Java 
Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to