Skip to content

Commit c8fd0bc

Browse files
authored
Merge pull request iluwatar#716 from baislsl/javadoc-fix
Improve Javadoc
2 parents e01d640 + e0b8f6f commit c8fd0bc

File tree

31 files changed

+90
-81
lines changed

31 files changed

+90
-81
lines changed

caching/src/main/java/com/iluwatar/caching/App.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
* whether the data is coming from the cache or the DB (i.e. separation of concern). The AppManager
5353
* ({@link AppManager}) handles the transaction of data to-and-from the underlying data store
5454
* (depending on the preferred caching policy/strategy).
55-
*
56-
* <i>App --> AppManager --> CacheStore/LRUCache/CachingPolicy --> DBManager</i>
55+
* <p>
56+
* <i>{@literal App --> AppManager --> CacheStore/LRUCache/CachingPolicy --> DBManager} </i>
5757
* </p>
5858
*
5959
* @see CacheStore
60-
* @See LRUCache
60+
* @see LruCache
6161
* @see CachingPolicy
6262
*
6363
*/

dao/src/main/java/com/iluwatar/dao/InMemoryCustomerDao.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/**
3232
* An in memory implementation of {@link CustomerDao}, which stores the customers in JVM memory
3333
* and data is lost when the application exits.
34-
* <br/>
34+
* <br>
3535
* This implementation is useful as temporary database or for testing.
3636
*/
3737
public class InMemoryCustomerDao implements CustomerDao {

data-bus/src/main/java/com/iluwatar/databus/App.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
/**
3535
* The Data Bus pattern
3636
* <p>
37-
* <p>{@see http://wiki.c2.com/?DataBusPattern}</p>
38-
* <p>
37+
* @see <a href="http://wiki.c2.com/?DataBusPattern">http://wiki.c2.com/?DataBusPattern</a>
3938
* <p>The Data-Bus pattern provides a method where different parts of an application may
4039
* pass messages between each other without needing to be aware of the other's existence.</p>
4140
* <p>Similar to the {@code ObserverPattern}, members register themselves with the {@link DataBus}

event-driven-architecture/src/main/java/com/iluwatar/eda/App.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* An event-driven architecture (EDA) is a framework that orchestrates behavior around the
3535
* production, detection and consumption of events as well as the responses they evoke. An event is
36-
* any identifiable occurrence that has significance for system hardware or software. <p/> The
36+
* any identifiable occurrence that has significance for system hardware or software. <p> The
3737
* example below uses an {@link EventDispatcher} to link/register {@link Event} objects to their
3838
* respective handlers once an {@link Event} is dispatched, it's respective handler is invoked and
3939
* the {@link Event} is handled accordingly.

factory-kit/src/main/java/com/iluwatar/factorykit/App.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class App {
4545
/**
4646
* Program entry point.
4747
*
48-
* @param args @param args command line args
48+
* @param args command line args
4949
*/
5050
public static void main(String[] args) {
5151
WeaponFactory factory = WeaponFactory.factory(builder -> {

feature-toggle/src/main/java/com/iluwatar/featuretoggle/App.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class App {
6767
* @see UserGroup
6868
* @see Service
6969
* @see PropertiesFeatureToggleVersion
70-
* @see com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion;
70+
* @see com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion
7171
*/
7272
public static void main(String[] args) {
7373

feature-toggle/src/main/java/com/iluwatar/featuretoggle/pattern/Service.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public interface Service {
4747
/**
4848
* Returns if the welcome message to be displayed will be the enhanced version.
4949
*
50-
* @return Boolean {@value true} if enhanced.
50+
* @return Boolean {@code true} if enhanced.
5151
*/
5252
boolean isEnhanced();
5353

feature-toggle/src/main/java/com/iluwatar/featuretoggle/pattern/propertiesversion/PropertiesFeatureToggleVersion.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public String getWelcomeMessage(final User user) {
9191
* see the value of the boolean that was set in the constructor
9292
* {@link PropertiesFeatureToggleVersion#PropertiesFeatureToggleVersion(Properties)}
9393
*
94-
* @return Boolean value {@value true} if enhanced.
94+
* @return Boolean value {@code true} if enhanced.
9595
*/
9696
@Override
9797
public boolean isEnhanced() {

feature-toggle/src/main/java/com/iluwatar/featuretoggle/pattern/tieredversion/TieredFeatureToggleVersion.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public String getWelcomeMessage(User user) {
6565
* is driven by the user group. This method is a little redundant. However can be used to show that there is an
6666
* enhanced version available.
6767
*
68-
* @return Boolean value {@value true} if enhanced.
68+
* @return Boolean value {@code true} if enhanced.
6969
*/
7070
@Override
7171
public boolean isEnhanced() {

guarded-suspension/src/main/java/com/iluwatar/guarded/suspension/GuardedQueue.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* Guarded Queue is an implementation for Guarded Suspension Pattern
3333
* Guarded suspension pattern is used to handle a situation when you want to execute a method
3434
* on an object which is not in a proper state.
35-
* @see http://java-design-patterns.com/patterns/guarded-suspension/
35+
* @see <a href="http://java-design-patterns.com/patterns/guarded-suspension/">http://java-design-patterns.com/patterns/guarded-suspension/</a>
3636
*/
3737
public class GuardedQueue {
3838
private static final Logger LOGGER = LoggerFactory.getLogger(GuardedQueue.class);

half-sync-half-async/src/main/java/com/iluwatar/halfsynchalfasync/App.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,31 @@
3333
* {@link AsyncTask} and {@link AsynchronousService}.
3434
*
3535
* <p>
36-
* <i>PROBLEM</i> <br/>
36+
* <i>PROBLEM</i> <br>
3737
* A concurrent system have a mixture of short duration, mid duration and long duration tasks. Mid
3838
* or long duration tasks should be performed asynchronously to meet quality of service
3939
* requirements.
4040
*
4141
* <p>
42-
* <i>INTENT</i> <br/>
42+
* <i>INTENT</i> <br>
4343
* The intent of this pattern is to separate the the synchronous and asynchronous processing in the
4444
* concurrent application by introducing two intercommunicating layers - one for sync and one for
4545
* async. This simplifies the programming without unduly affecting the performance.
4646
*
4747
* <p>
48-
* <i>APPLICABILITY</i> <br/>
48+
* <i>APPLICABILITY</i> <br>
4949
* UNIX network subsystems - In operating systems network operations are carried out
50-
* asynchronously with help of hardware level interrupts.<br/>
50+
* asynchronously with help of hardware level interrupts.<br>
5151
* CORBA - At the asynchronous layer one thread is associated with each socket that is connected
5252
* to the client. Thread blocks waiting for CORBA requests from the client. On receiving request it
5353
* is inserted in the queuing layer which is then picked up by synchronous layer which processes the
54-
* request and sends response back to the client.<br/>
54+
* request and sends response back to the client.<br>
5555
* Android AsyncTask framework - Framework provides a way to execute long running blocking
5656
* calls, such as downloading a file, in background threads so that the UI thread remains free to
57-
* respond to user inputs.<br/>
57+
* respond to user inputs.<br>
5858
*
5959
* <p>
60-
* <i>IMPLEMENTATION</i> <br/>
60+
* <i>IMPLEMENTATION</i> <br>
6161
* The main method creates an asynchronous service which does not block the main thread while the
6262
* task is being performed. The main thread continues its work which is similar to Async Method
6363
* Invocation pattern. The difference between them is that there is a queuing layer between

hexagonal/src/main/java/com/iluwatar/hexagonal/App.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050
* from the services it uses.<p>
5151
*
5252
* The primary ports for the application are console interfaces
53-
* {@link ConsoleAdministration} through which the lottery round is
54-
* initiated and run and {@link ConsoleLottery} that allows players to
53+
* {@link com.iluwatar.hexagonal.administration.ConsoleAdministration} through which the lottery round is
54+
* initiated and run and {@link com.iluwatar.hexagonal.service.ConsoleLottery} that allows players to
5555
* submit lottery tickets for the draw.<p>
5656
*
57-
* The secondary ports that application core uses are {@link WireTransfers}
58-
* which is a banking service, {@link LotteryEventLog} that delivers
59-
* eventlog as lottery events occur and {@link LotteryTicketRepository}
57+
* The secondary ports that application core uses are {@link com.iluwatar.hexagonal.banking.WireTransfers}
58+
* which is a banking service, {@link com.iluwatar.hexagonal.eventlog.LotteryEventLog} that delivers
59+
* eventlog as lottery events occur and {@link com.iluwatar.hexagonal.database.LotteryTicketRepository}
6060
* that is the storage for the lottery tickets.
6161
*
6262
*/

mediator/src/test/java/com/iluwatar/mediator/PartyMemberTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void testAct(Supplier<PartyMember> memberSupplier) {
110110
}
111111

112112
/**
113-
* Verify if {@link PartyMember#toString()} generate the expected output
113+
* Verify if {@link PartyMemberBase#toString()} generate the expected output
114114
*/
115115
@ParameterizedTest
116116
@MethodSource("dataProvider")

naked-objects/webapp/src/main/java/domainapp/webapp/SimpleApplication.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151
* See:
5252
*
5353
* <pre>
54-
* &lt;filter>
55-
* &lt;filter-name>wicket&lt;/filter-name>
56-
* &lt;filter-class>org.apache.wicket.protocol.http.WicketFilter&lt;/filter-class>
57-
* &lt;init-param>
58-
* &lt;param-name>applicationClassName&lt;/param-name>
59-
* &lt;param-value>webapp.SimpleApplication&lt;/param-value>
60-
* &lt;/init-param>
61-
* &lt;/filter>
54+
* &lt;filter&gt;
55+
* &lt;filter-name&gt;wicket&lt;/filter-name&gt;
56+
* &lt;filter-class&gt;org.apache.wicket.protocol.http.WicketFilter&lt;/filter-class&gt;
57+
* &lt;init-param&gt;
58+
* &lt;param-name&gt;applicationClassName&lt;/param-name&gt;
59+
* &lt;param-value&gt;webapp.SimpleApplication&lt;/param-value&gt;
60+
* &lt;/init-param&gt;
61+
* &lt;/filter&gt;
6262
* </pre>
6363
*
6464
*/
@@ -69,7 +69,7 @@ public class SimpleApplication extends IsisWicketApplication {
6969
/**
7070
* uncomment for a (slightly hacky) way of allowing logins using query args, eg:
7171
*
72-
* <tt>?user=sven&pass=pass</tt>
72+
* <tt>{@code ?user=sven&pass=pass}</tt>
7373
*
7474
* <p>
7575
* for demos only, obvious.

observer/src/main/java/com/iluwatar/observer/generic/Observable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.util.concurrent.CopyOnWriteArrayList;
2727

2828
/**
29-
* Generic observer inspired by Java Generics and Collection by Naftalin & Wadler
29+
* Generic observer inspired by Java Generics and Collection by {@literal Naftalin & Wadler}
3030
*
3131
* @param <S> Subject
3232
* @param <O> Observer

reactor/src/main/java/com/iluwatar/reactor/app/App.java

+22-16
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
* Service where it listens on multiple TCP or UDP sockets for incoming log requests.
4040
*
4141
* <p>
42-
* <i>INTENT</i> <br/>
42+
* <i>INTENT</i> <br>
4343
* The Reactor design pattern handles service requests that are delivered concurrently to an
4444
* application by one or more clients. The application can register specific handlers for processing
4545
* which are called by reactor on specific events.
4646
*
4747
* <p>
48-
* <i>PROBLEM</i> <br/>
48+
* <i>PROBLEM</i> <br>
4949
* Server applications in a distributed system must handle multiple clients that send them service
5050
* requests. Following forces need to be resolved:
5151
* <ul>
@@ -56,31 +56,37 @@
5656
* </ul>
5757
*
5858
* <p>
59-
* <i>PARTICIPANTS</i> <br/>
59+
* <i>PARTICIPANTS</i> <br>
6060
* <ul>
61-
* <li>Synchronous Event De-multiplexer</li> {@link NioReactor} plays the role of synchronous event
62-
* de-multiplexer. It waits for events on multiple channels registered to it in an event loop.
63-
*
61+
* <li>Synchronous Event De-multiplexer
6462
* <p>
65-
* <li>Initiation Dispatcher</li> {@link NioReactor} plays this role as the application specific
66-
* {@link ChannelHandler}s are registered to the reactor.
67-
*
63+
* {@link NioReactor} plays the role of synchronous event de-multiplexer.
64+
* It waits for events on multiple channels registered to it in an event loop.
65+
* </p>
66+
* </li>
67+
* <li>Initiation Dispatcher
6868
* <p>
69-
* <li>Handle</li> {@link AbstractNioChannel} acts as a handle that is registered to the reactor.
69+
* {@link NioReactor} plays this role as the application specific {@link ChannelHandler}s
70+
* are registered to the reactor.
71+
* </p>
72+
* </li>
73+
* <li>Handle
74+
* <p>
75+
* {@link AbstractNioChannel} acts as a handle that is registered to the reactor.
7076
* When any events occur on a handle, reactor calls the appropriate handler.
71-
*
77+
* </p>
78+
* </li>
79+
* <li>Event Handler
7280
* <p>
73-
* <li>Event Handler</li> {@link ChannelHandler} acts as an event handler, which is bound to a
81+
* {@link ChannelHandler} acts as an event handler, which is bound to a
7482
* channel and is called back when any event occurs on any of its associated handles. Application
7583
* logic resides in event handlers.
84+
* </p>
85+
* </li>
7686
* </ul>
77-
*
78-
* <p>
7987
* The application utilizes single thread to listen for requests on all ports. It does not create a
8088
* separate thread for each client, which provides better scalability under load (number of clients
8189
* increase).
82-
*
83-
* <p>
8490
* The example uses Java NIO framework to implement the Reactor.
8591
*
8692
*/

reactor/src/main/java/com/iluwatar/reactor/app/AppClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static class TcpLoggingClient implements Runnable {
108108
* Creates a new TCP logging client.
109109
*
110110
* @param clientName the name of the client to be sent in logging requests.
111-
* @param port the port on which client will send logging requests.
111+
* @param serverPort the port on which client will send logging requests.
112112
*/
113113
public TcpLoggingClient(String clientName, int serverPort) {
114114
this.clientName = clientName;

reactor/src/main/java/com/iluwatar/reactor/framework/AbstractNioChannel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void flush(SelectionKey key) throws IOException {
141141
* when this method returns. It will be written when the channel is flushed.
142142
*
143143
* <p>
144-
* This method is used by the {@link ChannelHandler} to send reply back to the client. <br/>
144+
* This method is used by the {@link ChannelHandler} to send reply back to the client. <br>
145145
* Example:
146146
*
147147
* <pre>

reactor/src/main/java/com/iluwatar/reactor/framework/Dispatcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* Represents the event dispatching strategy. When {@link NioReactor} senses any event on the
2929
* registered {@link AbstractNioChannel}s then it de-multiplexes the event type, read or write or
3030
* connect, and then calls the {@link Dispatcher} to dispatch the read events. This decouples the
31-
* I/O processing from application specific processing. <br/>
31+
* I/O processing from application specific processing. <br>
3232
* Dispatcher should call the {@link ChannelHandler} associated with the channel on which event
3333
* occurred.
3434
*

reactor/src/main/java/com/iluwatar/reactor/framework/SameThreadDispatcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
public class SameThreadDispatcher implements Dispatcher {
3838

3939
/**
40-
* Dispatches the read event in the context of caller thread. <br/>
40+
* Dispatches the read event in the context of caller thread. <br>
4141
* Note this is a blocking call. It returns only after the associated handler has handled the read
4242
* event.
4343
*/

reactor/src/main/java/com/iluwatar/reactor/framework/ThreadPoolDispatcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public ThreadPoolDispatcher(int poolSize) {
4747

4848
/**
4949
* Submits the work of dispatching the read event to worker pool, where it gets picked up by
50-
* worker threads. <br/>
50+
* worker threads. <br>
5151
* Note that this is a non-blocking call and returns immediately. It is not guaranteed that the
5252
* event has been handled by associated handler.
5353
*/

reader-writer-lock/src/main/java/com/iluwatar/reader/writer/lock/ReaderWriterLock.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public class ReaderWriterLock implements ReadWriteLock {
5050
/**
5151
* Global mutex is used to indicate that whether reader or writer gets the lock in the moment.
5252
* <p>
53-
* 1. When it contains the reference of {@link readerLock}, it means that the lock is acquired by the reader, another
53+
* 1. When it contains the reference of {@link #readerLock}, it means that the lock is acquired by the reader, another
5454
* reader can also do the read operation concurrently. <br>
55-
* 2. When it contains the reference of reference of {@link writerLock}, it means that the lock is acquired by the
55+
* 2. When it contains the reference of reference of {@link #writerLock}, it means that the lock is acquired by the
5656
* writer exclusively, no more reader or writer can get the lock.
5757
* <p>
5858
* This is the most important field in this class to control the access for reader/writer.

resource-acquisition-is-initialization/src/main/java/com/iluwatar/resource/acquisition/is/initialization/App.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
* In RAII resource is tied to object lifetime: resource allocation is done during object creation
3434
* while resource deallocation is done during object destruction.
3535
* <p>
36-
* In Java RAII is achieved with try-with-resources statement and interfaces {@link Closeable} and
36+
* In Java RAII is achieved with try-with-resources statement and interfaces {@link java.io.Closeable} and
3737
* {@link AutoCloseable}. The try-with-resources statement ensures that each resource is closed at
3838
* the end of the statement. Any object that implements {@link java.lang.AutoCloseable}, which
3939
* includes all objects which implement {@link java.io.Closeable}, can be used as a resource.
4040
*
4141
* In this example, {@link SlidingDoor} implements {@link AutoCloseable} and {@link TreasureChest}
42-
* implements {@link Closeable}. Running the example, we can observe that both resources are
42+
* implements {@link java.io.Closeable}. Running the example, we can observe that both resources are
4343
* automatically closed.
4444
* <p>
4545
* http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html

service-locator/src/main/java/com/iluwatar/servicelocator/Service.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
/**
2626
* This is going to be the parent service interface which we will use to create our services. All
27-
* services will have a <li>service name</li> <li>unique id</li> <li>execution work flow</li>
27+
* services will have a <ul><li>service name</li> <li>unique id</li> <li>execution work flow</li></ul>
2828
*
2929
* @author saifasif
3030
*

singleton/src/main/java/com/iluwatar/singleton/App.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,35 @@
2828
/**
2929
* Singleton pattern ensures that the class can have only one existing instance per Java classloader
3030
* instance and provides global access to it.
31-
* <p/>
31+
* <p>
3232
* One of the risks of this pattern is that bugs resulting from setting a singleton up in a
3333
* distributed environment can be tricky to debug, since it will work fine if you debug with a
3434
* single classloader. Additionally, these problems can crop up a while after the implementation of
3535
* a singleton, since they may start out synchronous and only become async with time, so you it may
3636
* not be clear why you are seeing certain changes in behaviour.
37-
* <p/>
37+
* <p>
3838
* There are many ways to implement the Singleton. The first one is the eagerly initialized instance
3939
* in {@link IvoryTower}. Eager initialization implies that the implementation is thread safe. If
4040
* you can afford giving up control of the instantiation moment, then this implementation will suit
4141
* you fine.
42-
* <p/>
42+
* <p>
4343
* The other option to implement eagerly initialized Singleton is enum based Singleton. The example
4444
* is found in {@link EnumIvoryTower}. At first glance the code looks short and simple. However, you
4545
* should be aware of the downsides including committing to implementation strategy, extending the
4646
* enum class, serializability and restrictions to coding. These are extensively discussed in Stack
4747
* Overflow:
4848
* http://programmers.stackexchange.com/questions/179386/what-are-the-downsides-of-implementing
4949
* -a-singleton-with-javas-enum
50-
* <p/>
50+
* <p>
5151
* {@link ThreadSafeLazyLoadedIvoryTower} is a Singleton implementation that is initialized on
5252
* demand. The downside is that it is very slow to access since the whole access method is
5353
* synchronized.
54-
* <p/>
54+
* <p>
5555
* Another Singleton implementation that is initialized on demand is found in
5656
* {@link ThreadSafeDoubleCheckLocking}. It is somewhat faster than
5757
* {@link ThreadSafeLazyLoadedIvoryTower} since it doesn't synchronize the whole access method but
5858
* only the method internals on specific conditions.
59-
* <p/>
59+
* <p>
6060
* Yet another way to implement thread safe lazily initialized Singleton can be found in
6161
* {@link InitializingOnDemandHolderIdiom}. However, this implementation requires at least Java 8
6262
* API level to work.

0 commit comments

Comments
 (0)