Skip to content

Commit

Permalink
Use SLASHSTAR instead of JAVADOC for Java
Browse files Browse the repository at this point in the history
In Java JAVADOC-style comment blocks are intended for comments
interpreted by documentation building tools such as `javadoc`. Strictly
speaking, the license header block should not be interpreted by these
tools. The common approach in Java is to use the uninterpreted
SLASHSTAR-style of comments for the license header.

Recent iterations of the JDK have been getting stricter with its
parsing of Javadoc comment blocks; floating comment block not applied to
any Java element (type, method, or field) may well result in warnings in
future versions of the compiler. In JetBrain's IntelliJ Java IDE,
Javadoc-style license headers already cause a syntax warning.

While the style of comments can be configured (as mentioned in mathieucarbou#43
'License headers shouldn't be in Javadoc style') a sensible default
seems preferable.
  • Loading branch information
jdhoek committed Aug 12, 2016
1 parent 18aeb89 commit b3e4193
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public enum DocumentType {
HAML("haml", HeaderType.HAML_STYLE),
HTM("htm", HeaderType.XML_STYLE),
HTML("html", HeaderType.XML_STYLE),
JAVA("java", HeaderType.JAVADOC_STYLE),
JAVAFX("fx", HeaderType.JAVADOC_STYLE),
JAVA("java", HeaderType.SLASHSTAR_STYLE),
JAVAFX("fx", HeaderType.SLASHSTAR_STYLE),
JAVASCRIPT("js", HeaderType.SLASHSTAR_STYLE),
JSP("jsp", HeaderType.DYNASCRIPT_STYLE),
JSPX("jspx", HeaderType.XML_STYLE),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) ${year} http://code.google.com/p/maven-license-plugin/
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) ${year} http://code.google.com/p/maven-license-plugin/
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit b3e4193

Please sign in to comment.