Skip to content

Commit 5b12277

Browse files
jbertramclebertsuconic
authored andcommitted
ARTEMIS-5314 overhaul JavaDoc formatting & content
This commit overhauls JavaDoc formatting & content across the entire code-base placing a heavy emphasis on the don't-repeat-yourself principle (i.e. DRY). The main goals here are readability, conciseness, and safeguarding future commits from the same kinds of mistakes that have plagued the code-base for many years now. It includes the following changes: - Remove empty @param, @throws, & @return tags. - Remove useless/boilerplate comments. - Re-wrap to 120 characters. Many comments already used this limit while others were less than and still other were more than this limit. Using 120 was a happy medium. - Enforce multi-line syntax, e.g.: /** * Lorem ipsum */ - Change /** to /* where appropriate (e.g. license headers, intra-method comments, etc.) - Change /* to /** where appropriate (e.g. method descriptions, comments using tags like @code, etc.) - Remove trailing or extraneous '*' characters. - Remove JavaDocs from implementations when the JavaDocs of the interface will suffice. - Use {@code Lorem ipsum} syntax where appropriate. - Use <p> for empty lines. Remove <br>, <br/>, & <br /> - Use the {@return ...} sytanx introduced in Java 16. Details are at https://bugs.openjdk.org/browse/JDK-8256804. - Align @param descriptions. - Align @throws descriptions. - Add empty line between description and start of tags (e.g. @param). - Fix the prolific "whether or not" to the more correct just "whether". - Enforce many of these standards via checkstyle. - Remove references to defunct issue trackers or forums. - Convert single line comments using /* syntax to use //.
1 parent 8eb52ef commit 5b12277

1,515 files changed

Lines changed: 11172 additions & 21052 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
import java.util.List;
2929

3030
/**
31-
* <p>
32-
* A main class which setups up a classpath and then passes
33-
* execution off to the ActiveMQ Artemis cli main.
34-
* </p>
31+
* A main class which setups up a classpath and then passes execution off to the ActiveMQ Artemis cli main.
3532
*/
3633
public class Artemis {
3734

artemis-cdi-client/src/main/java/org/apache/artemis/client/cdi/configuration/ArtemisClientConfiguration.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ public interface ArtemisClientConfiguration {
2828
String REMOTE_CONNECTOR = NettyConnectorFactory.class.getName();
2929

3030
/**
31-
* @return if present, sends a username for the connection
31+
* {@return if present, sends a username for the connection}
3232
*/
3333
String getUsername();
3434

3535
/**
36-
* @return the password for the connection. If username is set, password must be set
36+
* {@return the password for the connection. If username is set, password must be set}
3737
*/
3838
String getPassword();
3939

@@ -45,32 +45,32 @@ public interface ArtemisClientConfiguration {
4545
String getUrl();
4646

4747
/**
48-
* @return The hostname to connect to
48+
* {@return The hostname to connect to}
4949
*/
5050
String getHost();
5151

5252
/**
53-
* @return the port number to connect to
53+
* {@return the port number to connect to}
5454
*/
5555
Integer getPort();
5656

5757
/**
58-
* @return the connector factory to use for connections.
58+
* {@return the connector factory to use for connections}
5959
*/
6060
String getConnectorFactory();
6161

6262
/**
63-
* @return Whether or not to start the embedded broker
63+
* {@return whether to start the embedded broker}
6464
*/
6565
boolean startEmbeddedBroker();
6666

6767
/**
68-
* @return whether or not this is an HA connection
68+
* {@return whether this is an HA connection}
6969
*/
7070
boolean isHa();
7171

7272
/**
73-
* @return whether or not the authentication parameters should be used
73+
* {@return whether the authentication parameters should be used}
7474
*/
7575
boolean hasAuthentication();
7676
}

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@
6262

6363
/**
6464
* Artemis is the main CLI entry point for managing/running a broker.
65-
*
66-
* Want to start or debug a broker from an IDE? This is probably the best class to
67-
* run. Make sure set the -Dartemis.instance=path/to/instance system property.
68-
* You should also use the 'apache-artemis' module for the class path since that
69-
* includes all artemis modules.
70-
*
71-
* Notice that this class should not use any logging as it's part of the bootstrap and using logging here could
72-
* disrupt the order of bootstrapping on certain components (e.g. JMX being started from log4j)
65+
* <p>
66+
* Want to start or debug a broker from an IDE? This is probably the best class to run. Make sure set the
67+
* -Dartemis.instance=path/to/instance system property. You should also use the 'apache-artemis' module for the class
68+
* path since that includes all artemis modules.
69+
* <p>
70+
* Notice that this class should not use any logging as it's part of the bootstrap and using logging here could disrupt
71+
* the order of bootstrapping on certain components (e.g. JMX being started from log4j)
7372
*/
7473
@Command(name = "artemis", description = "ActiveMQ Artemis Command Line")
7574
public class Artemis implements Runnable {
@@ -194,8 +193,7 @@ public static Object execute(boolean inputEnabled, boolean useSystemOut, boolean
194193
}
195194

196195
/**
197-
* This method is used to validate exception returns.
198-
* Useful on test cases
196+
* This method is used to validate exception returns. Useful on test cases.
199197
*/
200198
private static Object internalExecute(boolean shellEnabled, File artemisHome, File artemisInstance, File etcFolder, String[] args) throws Exception {
201199
return internalExecute(shellEnabled, artemisHome, artemisInstance, etcFolder, args, new ActionContext());

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ public void setHomeValues(File brokerHome, File brokerInstance, File etcFolder)
8282
@Override
8383
public String getBrokerInstance() {
8484
if (brokerInstance == null) {
85-
/* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows
86-
the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this
87-
reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. */
85+
/*
86+
* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows
87+
* the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this
88+
* reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes.
89+
*/
8890
brokerInstance = System.getProperty("artemis.instance");
8991
if (brokerInstance != null) {
9092
brokerInstance = brokerInstance.replace("\\", "/");
@@ -188,9 +190,11 @@ public URI getBrokerURIInstance() {
188190
@Override
189191
public String getBrokerHome() {
190192
if (brokerHome == null) {
191-
/* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows
192-
the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this
193-
reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. */
193+
/*
194+
* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows
195+
* the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this
196+
* reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes.
197+
*/
194198
brokerHome = System.getProperty("artemis.home");
195199
if (brokerHome != null) {
196200
brokerHome = brokerHome.replace("\\", "/");

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import picocli.CommandLine.Parameters;
3535

3636
/**
37-
* Abstract class where we can replace the configuration in various places *
37+
* Abstract class where we can replace the configuration in various places
3838
*/
3939
public abstract class Configurable extends ActionAbstract {
4040

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ public class InputAbstract extends ActionAbstract {
2828
private static boolean inputEnabled = false;
2929

3030
/**
31-
* Test cases validating or using the CLI cannot deal with inputs,
32-
* so they are generally disabled, however the main method from the CLI will enable it back. */
31+
* Test cases validating or using the CLI cannot deal with inputs, so they are generally disabled, however the main
32+
* method from the CLI will enable it back.
33+
*/
3334
public static void enableInput() {
3435
inputEnabled = true;
3536
}

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ public class Run extends LockAbstract {
6161
private Timer shutdownTimer;
6262

6363
/**
64-
* This will disable the System.exit at the end of the server.stop, as that means there are other things
65-
* happening on the same VM.
66-
*
67-
* @param embedded
64+
* This will disable the System.exit at the end of the server.stop, as that means there are other things happening on
65+
* the same VM.
6866
*/
6967
public static void setEmbedded(boolean embedded) {
7068
Run.embedded = true;
@@ -164,8 +162,6 @@ public void deActivate() {
164162

165163
/**
166164
* Add a simple shutdown hook to stop the server.
167-
*
168-
* @param configurationDir
169165
*/
170166
private void addShutdownHook(File configurationDir) {
171167

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/helper/HelperCreate.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
import org.slf4j.Logger;
3131
import org.slf4j.LoggerFactory;
3232

33-
/** This is a class simulating what the Artemis Maven Plugin does.
34-
* You may use by creating a new instance, filling the properties, and calling the method create */
33+
/**
34+
* This is a class simulating what the Artemis Maven Plugin does. You may use by creating a new instance, filling the
35+
* properties, and calling the method create
36+
*/
3537
public class HelperCreate extends HelperBase {
3638

3739
public HelperCreate(String homeProperty) {
@@ -76,9 +78,6 @@ public HelperCreate(File artemisHome) {
7678

7779
private boolean failoverOnShutdown = false;
7880

79-
/**
80-
* it will disable auto-tune
81-
*/
8281
private boolean noAutoTune = true;
8382

8483
private String messageLoadBalancing = "ON_DEMAND";
@@ -384,5 +383,4 @@ private void copyConfigurationFiles(String[] list,
384383
}
385384
}
386385
}
387-
388386
}

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/AsyncJms2ProducerFacade.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ private void addedPendingSend() {
132132
}
133133

134134
/**
135-
* if {@code true}, a subsequent {@link #trySend} would return {@link SendAttemptResult#Success}.<br>
136-
* Otherwise, a subsequent {@link #trySend} would return {@link SendAttemptResult#NotAvailable}.
135+
* If {@code true}, a subsequent {@link #trySend} would return {@link SendAttemptResult#Success}. Otherwise, a
136+
* subsequent {@link #trySend} would return {@link SendAttemptResult#NotAvailable}.
137137
*/
138138
private boolean isAvailable() {
139139
if (maxPending > 0 && pending == maxPending) {

artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/PaddingDecimalFormat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public class PaddingDecimalFormat extends DecimalFormat {
2626
private final StringBuilder pad;
2727

2828
/**
29-
* Creates a PaddingDecimalFormat using the given pattern and minimum {@code minLength} and the symbols for the default
30-
* locale.
29+
* Creates a PaddingDecimalFormat using the given pattern and minimum {@code minLength} and the symbols for the
30+
* default locale.
3131
*/
3232
public PaddingDecimalFormat(String pattern, int minLength) {
3333
super(pattern);

0 commit comments

Comments
 (0)