@@ -170,6 +170,11 @@ private void process(final List<File> files, final List<String> classNames) thro
170170 classNameUsed (lines , classNames , relativePath );
171171 spaces (lines , relativePath );
172172 indentation (lines , relativePath );
173+ if (!"package-info.java" .equals (file .getName ())) {
174+ authorTagAtLeastOne (lines , relativePath );
175+ authorTagNoDuplicates (lines , relativePath );
176+ authorTagRonaldBrill (lines , relativePath );
177+ }
173178 }
174179 }
175180 }
@@ -826,6 +831,48 @@ private void alertVerifyOrder(final String browserName, final List<String> previ
826831 }
827832 }
828833
834+ /**
835+ * Checks that the file contains at least one {@code @author} tag.
836+ */
837+ private void authorTagAtLeastOne (final List <String > lines , final String path ) {
838+ final boolean hasAuthor = lines .stream ()
839+ .anyMatch (line -> line .trim ().startsWith ("* @author" ));
840+ if (!hasAuthor ) {
841+ addFailure (path , 0 , "Missing @author tag" );
842+ }
843+ }
844+
845+ /**
846+ * Checks that the file contains no duplicate {@code @author} tags
847+ * (same author name listed more than once).
848+ */
849+ private void authorTagNoDuplicates (final List <String > lines , final String path ) {
850+ final List <String > authors = new ArrayList <>();
851+ for (int i = 0 ; i < lines .size (); i ++) {
852+ final String trimmed = lines .get (i ).trim ();
853+ if (trimmed .startsWith ("* @author" )) {
854+ final String author = trimmed .substring ("* @author" .length ()).trim ();
855+ if (authors .contains (author )) {
856+ addFailure (path , i + 1 , "Duplicate @author tag: " + author );
857+ }
858+ else {
859+ authors .add (author );
860+ }
861+ }
862+ }
863+ }
864+
865+ /**
866+ * Checks that the file contains an {@code @author Ronald Brill} tag.
867+ */
868+ private void authorTagRonaldBrill (final List <String > lines , final String path ) {
869+ final boolean hasRonaldBrill = lines .stream ()
870+ .anyMatch (line -> line .trim ().equals ("* @author Ronald Brill" ));
871+ if (!hasRonaldBrill ) {
872+ addFailure (path , 0 , "Missing @author Ronald Brill tag" );
873+ }
874+ }
875+
829876 /**
830877 * Verifies that no extra leading spaces (in test code).
831878 */
0 commit comments