Looking for good example of Java code that has Javadoc comments
I've been running Checkstyle on some code and looking for a good example to get to grips with how to add comments for specific purposes.
For example Checkstyle says I should add comments for constants/class variables. Yet nowhere in the official docs Oracle host, can I find an example of this.
I was looking in various places, but couldn't find a concise example... 1 2 3 4 5
I figured if I could get my hands on the source code for the Java Calendar class, it would be a good example. You can see all sorts of constants in the API docs of that class.
See here.
How can I eithe开发者_StackOverflow中文版r:
1) Get my hands on the source for Calendar?
2) Find an example of how you'd document code like this in Javadoc (Checkstyle flags it needs it):
private static final int NO_OF_RECORDS = 10;
On the Java 6 download page, under the "additional resources" section, you can download the source code for the whole JDK.
Additionally, most IDEs automatically index the source code for Java's library classes so you can open those classes transparently.
Oracle's current java 6 source download links to http://download.java.net/jdk6/source/ which should contain the entire java library source.
精彩评论