Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Eclipse generate two comment blocks into a package-info.java

When I right-klick on a package -> new -> package, check the "create package-info.java", Eclipse 4.4.2 puts a template for a package-info.java into that directory. That's good. It looks like this:

/**
 * 
 */
/**
 * @author John Doe
 *
 */
package name.of.pkg;

As you can see, there are two blocks of comments. My question is: what is the purpose of the upper block?

I can't see that this shows up anywhere in the generated JavaDoc HTML. Only content in the lower comment block and above the author becomes visible in the output. The two lines that just have a star in their line are inviting but won't be visible in the output. I never saw two comment blocks in any blog or documentation about package-info.java so far.

like image 751
Stefan Bormann Avatar asked Oct 30 '15 08:10

Stefan Bormann


1 Answers

The top piece is the license agreement. When you get into professional programming licenses become very important in letting other people know where, how, and if they may use this code.

Common sytax is:

/**
 * LICENSE
 */

import java.util.*;

/**
 * JavaDoc about the class
 *
 * @author Your Name <[email protected]>
 */
public class ClassName {}
like image 164
Gemtastic Avatar answered Oct 29 '22 16:10

Gemtastic