All public APIs, interfaces, and methods should include comprehensive JavaDoc that clearly explains their purpose, parameters, return values, and any non-obvious behaviors. This is especially important for:
All public APIs, interfaces, and methods should include comprehensive JavaDoc that clearly explains their purpose, parameters, return values, and any non-obvious behaviors. This is especially important for:
JavaDoc should be added at the time the code is written, not as an afterthought. For deprecations, ensure to include forRemoval=true
to clearly document the API lifecycle.
Example:
/**
* Context for handling application shutdown.
* Tasks can be registered with different priorities to control execution order.
*/
public interface ShutdownContext {
int DEFAULT_PRIORITY = Interceptor.Priority.LIBRARY_AFTER;
int SHUTDOWN_EVENT_PRIORITY = DEFAULT_PRIORITY + 100_000;
/**
* Adds a shutdown task with the default priority.
*
* @param runnable The task to execute during shutdown
*/
default void addShutdownTask(Runnable runnable) {
addShutdownTask(DEFAULT_PRIORITY, runnable);
}
/**
* Adds a shutdown task with the specified priority.
* Higher priority tasks are executed first during shutdown.
*
* @param priority Task execution priority - higher values run before lower values
* @param runnable The task to execute during shutdown
*/
void addShutdownTask(int priority, Runnable runnable);
}
Enter the URL of a public GitHub repository