Starting in Java 23, comments beginning with three slashes /// are interpreted as JavaDoc comments using Markdown syntax.
In Java 22 and earlier, comments starting with more than 2 slashes were treated as normal comments. Accidentally writing comments with three or more slashes can lead to unintended JavaDoc being generated, when migrating to Java 23.
Comments starting with three or more slashes will increase the migration cost when upgrading to Java 23 or later. Moreover, IDE or other tools may handle such comments as JavaDoc comments if they are not aware of the Java version.
In versions of Java prior to 23, comments should not start with more than 2 slashes, and from Java 23 forward they should not start with more than 3.
The following code will generate unintended JavaDoc comments if migrated to Java 23:
/// Some comment for the developers
public abstract void foo();
//// public void foo(String s){}
public void foo(){}
// Some comment for the developers
public abstract void foo();
// public void foo(String s){}
public void foo(){}