This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 3334009c3 Use Javadoc @code
3334009c3 is described below
commit 3334009c309f0b1f2ecf86af4a0b7a03f26a860b
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Jul 29 18:40:59 2024 -0400
Use Javadoc @code
---
.../java/org/apache/commons/lang3/ClassUtils.java | 4 +-
.../org/apache/commons/lang3/builder/Builder.java | 10 ++--
.../apache/commons/lang3/builder/DiffBuilder.java | 9 ++--
.../builder/MultilineRecursiveToStringStyle.java | 4 +-
.../lang3/builder/ReflectionDiffBuilder.java | 2 +-
.../commons/lang3/builder/ToStringBuilder.java | 4 +-
.../commons/lang3/builder/ToStringStyle.java | 14 ++---
.../concurrent/CallableBackgroundInitializer.java | 7 +--
.../commons/lang3/concurrent/LazyInitializer.java | 5 +-
.../lang3/concurrent/locks/LockingVisitors.java | 17 +++---
.../commons/lang3/concurrent/package-info.java | 60 ++++++++++------------
.../commons/lang3/event/EventListenerSupport.java | 6 +--
.../apache/commons/lang3/function/Failable.java | 5 +-
.../commons/lang3/function/MethodInvokers.java | 24 ++++-----
.../apache/commons/lang3/reflect/MethodUtils.java | 2 +-
.../apache/commons/lang3/reflect/TypeLiteral.java | 35 +++++++------
.../apache/commons/lang3/reflect/TypeUtils.java | 17 +++---
.../apache/commons/lang3/time/FastDateFormat.java | 4 +-
.../apache/commons/lang3/time/FastDateParser.java | 4 +-
.../apache/commons/lang3/time/FastDatePrinter.java | 4 +-
20 files changed, 119 insertions(+), 118 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/ClassUtils.java
b/src/main/java/org/apache/commons/lang3/ClassUtils.java
index c1fc66234..46c15f190 100644
--- a/src/main/java/org/apache/commons/lang3/ClassUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ClassUtils.java
@@ -766,9 +766,9 @@ public class ClassUtils {
* fall foul of Java bug <a
href="https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4071957">4071957</a>).
*
* <pre>
- * <code>Set set = Collections.unmodifiableSet(...);
+ * {@code Set set = Collections.unmodifiableSet(...);
* Method method = ClassUtils.getPublicMethod(set.getClass(), "isEmpty",
new Class[0]);
- * Object result = method.invoke(set, new Object[]);</code>
+ * Object result = method.invoke(set, new Object[]);}
* </pre>
*
* @param cls the class to check, not null
diff --git a/src/main/java/org/apache/commons/lang3/builder/Builder.java
b/src/main/java/org/apache/commons/lang3/builder/Builder.java
index 5146830f3..2f4c90279 100644
--- a/src/main/java/org/apache/commons/lang3/builder/Builder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/Builder.java
@@ -36,8 +36,8 @@ package org.apache.commons.lang3.builder;
*
* <p>
* Example Builder:
- * <pre><code>
- * class FontBuilder implements Builder<Font> {
+ * <pre>{@code
+ * class FontBuilder implements Builder<Font> {
* private Font font;
*
* public FontBuilder(String fontName) {
@@ -60,14 +60,14 @@ package org.apache.commons.lang3.builder;
* return this.font;
* }
* }
- * </code></pre>
+ * }</pre>
*
* Example Builder Usage:
- * <pre><code>
+ * <pre>{@code
* Font bold14ptSansSerifFont = new FontBuilder(Font.SANS_SERIF).bold()
* .size(14.0f)
* .build();
- * </code></pre>
+ * }</pre>
*
* @param <T> the type of object that the builder will construct or compute.
*
diff --git a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
index 49560e048..d14d1b9d0 100644
--- a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
@@ -33,7 +33,7 @@ import org.apache.commons.lang3.ObjectUtils;
* </p>
*
* <pre>{@code
- * public class Person implements Diffable<Person> {
+ * public class Person implements Diffable<Person> {
* String name;
* int age;
* boolean smoker;
@@ -346,10 +346,10 @@ public class DiffBuilder<T> implements
Builder<DiffResult<T>> {
* Useful this method to compare properties which are themselves Diffable
and would like to know which specific part of it is different.
* </p>
*
- * <pre>
- * public class Person implements Diffable<Person> {
+ * <pre>{@code
+ * public class Person implements Diffable<Person> {
* String name;
- * Address address; // implements Diffable<Address>
+ * Address address; // implements Diffable<Address>
*
* ...
*
@@ -360,6 +360,7 @@ public class DiffBuilder<T> implements
Builder<DiffResult<T>> {
* .build();
* }
* }
+ * }
* </pre>
*
* @param fieldName the field name
diff --git
a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
index 54cb160c7..8e7c356e2 100644
---
a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
+++
b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
@@ -49,7 +49,7 @@ import org.apache.commons.lang3.StringUtils;
*
* <p>
* This will produce a toString of the format:<br>
- * <code>Person@7f54[ <br>
+ * {@code Person@7f54[ <br>
* name=Stephen, <br>
* age=29, <br>
* smokealse, <br>
@@ -57,7 +57,7 @@ import org.apache.commons.lang3.StringUtils;
* title=Manager <br>
* ] <br>
* ]
- * </code>
+ * }
* </p>
*
* @since 3.4
diff --git
a/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java
b/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java
index 222cd249b..65f72adbb 100644
--- a/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java
@@ -37,7 +37,7 @@ import org.apache.commons.lang3.reflect.FieldUtils;
* </p>
*
* <pre>{@code
- * public class Person implements Diffable<Person> {
+ * public class Person implements Diffable<Person> {
* String name;
* int age;
* boolean smoker;
diff --git
a/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java
b/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java
index 3fa79db66..d387082d0 100644
--- a/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java
@@ -901,8 +901,8 @@ public class ToStringBuilder implements Builder<String> {
}
/**
- * Appends with the same format as the default <code>Object toString()
- * </code> method. Appends the class name followed by
+ * Appends with the same format as the default {@code Object toString()
+ * } method. Appends the class name followed by
* {@link System#identityHashCode(Object)}.
*
* @param srcObject the {@link Object} whose class name and id to output
diff --git a/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
b/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
index 0ab64efe3..c3796dad2 100644
--- a/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
+++ b/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
@@ -831,27 +831,27 @@ public abstract class ToStringStyle implements
Serializable {
private boolean defaultFullDetail = true;
/**
- * The {@code null} text {@code '<null>'}.
+ * The {@code null} text {@code "<null>"}.
*/
private String nullText = "<null>";
/**
- * The summary size text start {@code '<size'}.
+ * The summary size text start {@code "<size="}.
*/
private String sizeStartText = "<size=";
/**
- * The summary size text start {@code '>'}.
+ * The summary size text start {@code ">"}.
*/
private String sizeEndText = ">";
/**
- * The summary object text start {@code '<'}.
+ * The summary object text start {@code "<"}.
*/
private String summaryObjectStartText = "<";
/**
- * The summary object text start {@code '>'}.
+ * The summary object text start {@code ">"}.
*/
private String summaryObjectEndText = ">";
@@ -1793,7 +1793,7 @@ public abstract class ToStringStyle implements
Serializable {
/**
* Appends to the {@code toString} an indicator for {@code null}.
*
- * <p>The default indicator is {@code '<null>'}.</p>
+ * <p>The default indicator is {@code "<null>"}.</p>
*
* @param buffer the {@link StringBuffer} to populate
* @param fieldName the field name, typically not used as already appended
@@ -1960,7 +1960,7 @@ public abstract class ToStringStyle implements
Serializable {
* <p>The output consists of a prefix, the passed in size
* and a suffix.</p>
*
- * <p>The default format is {@code '<size=n>'}.</p>
+ * <p>The default format is {@code "<size=n>"}.</p>
*
* @param buffer the {@link StringBuffer} to populate
* @param fieldName the field name, typically not used as already appended
diff --git
a/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java
b/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java
index 7ab80c053..ade5533ab 100644
---
a/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java
+++
b/src/main/java/org/apache/commons/lang3/concurrent/CallableBackgroundInitializer.java
@@ -47,17 +47,18 @@ import java.util.concurrent.ExecutorService;
* typical usage example:
* </p>
*
- * <pre>
+ * <pre>{@code
* // a Callable that performs a complex computation
- * Callable<Integer> computationCallable = new MyComputationCallable();
+ * Callable<Integer> computationCallable = new MyComputationCallable();
* // setup the background initializer
- * CallableBackgroundInitializer<Integer> initializer =
+ * CallableBackgroundInitializer<Integer> initializer =
* new CallableBackgroundInitializer(computationCallable);
* initializer.start();
* // Now do some other things. Initialization runs in a parallel thread
* ...
* // Wait for the end of initialization and access the result
* Integer result = initializer.get();
+ * }
* </pre>
*
* @since 3.0
diff --git
a/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java
b/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java
index c638ceb69..1ea4b0f52 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java
@@ -37,13 +37,14 @@ import org.apache.commons.lang3.function.FailableSupplier;
* this class, a subclass of {@link LazyInitializer} has to be created:
* </p>
*
- * <pre>
- * public class ComplexObjectInitializer extends
LazyInitializer<ComplexObject> {
+ * <pre>{@code
+ * public class ComplexObjectInitializer extends
LazyInitializer<ComplexObject> {
* @Override
* protected ComplexObject initialize() {
* return new ComplexObject();
* }
* }
+ * }
* </pre>
*
* <p>
diff --git
a/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java
b/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java
index d83f52350..379febf44 100644
---
a/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java
+++
b/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java
@@ -59,22 +59,24 @@ import org.apache.commons.lang3.function.Suppliers;
* Example: A thread safe logger class.
* </p>
*
- * <pre>
+ * <pre>{@code
* public class SimpleLogger {
*
- * private final StampedLockVisitor<PrintStream> lock;
+ * private final StampedLockVisitor<PrintStream> lock;
*
* public SimpleLogger(OutputStream out) {
* lock = LockingVisitors.stampedLockVisitor(new PrintStream(out));
* }
*
* public void log(String message) {
- * lock.acceptWriteLocked((ps) -> ps.println(message));
+ * lock.acceptWriteLocked(ps -> ps.println(message));
* }
*
* public void log(byte[] buffer) {
- * lock.acceptWriteLocked((ps) -> { ps.write(buffer); ps.println();
});
+ * lock.acceptWriteLocked(ps -> { ps.write(buffer); ps.println(); });
* }
+ * }
+ * }
* </pre>
*
* @since 3.11
@@ -184,13 +186,14 @@ public class LockingVisitors {
* <em>Example:</em> Consider that the hidden object is a list, and we
wish to know the current size of the
* list. This might be achieved with the following:
* </p>
- * <pre>
- * private Lock<List<Object>> listLock;
+ * <pre>{@code
+ * private Lock<List<Object>> listLock;
*
* public int getCurrentListSize() {
- * final Integer sizeInteger = listLock.applyReadLocked((list)
-> Integer.valueOf(list.size));
+ * final Integer sizeInteger = listLock.applyReadLocked(list ->
Integer.valueOf(list.size));
* return sizeInteger.intValue();
* }
+ * }
* </pre>
*
* @param <T> The result type (both the functions, and this method's.)
diff --git
a/src/main/java/org/apache/commons/lang3/concurrent/package-info.java
b/src/main/java/org/apache/commons/lang3/concurrent/package-info.java
index b4260b0ff..e68218769 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/package-info.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/package-info.java
@@ -25,12 +25,11 @@
* which provides just a single method:
* </p>
*
- * <pre>
- * <code>
- * public interface ConcurrentInitializer<T> {
+ * <pre>{@code
+ * public interface ConcurrentInitializer<T> {
* T get() throws ConcurrentException;
* }
- * </code>
+ * }
* </pre>
*
* <p>
@@ -70,16 +69,15 @@
* implement to create the messaging service object:
* </p>
*
- * <pre>
- * <code>
- * public class MessagingServiceInitializer extends
LazyInitializer<MessagingService> {
+ * <pre>{@code
+ * public class MessagingServiceInitializer extends
LazyInitializer<MessagingService> {
* protected MessagingService initialize() throws ConcurrentException {
* // Do all necessary steps to create and initialize the service object
* MessagingService service = ...
* return service;
* }
* }
- * </code>
+ * }
* </pre>
*
* <p>
@@ -88,13 +86,12 @@
* obtained from the initializer, and the administrator is notified:
* </p>
*
- * <pre>
- * <code>
+ * <pre>{@code
* public class ServerThread implements Runnable {
* // The initializer for obtaining the messaging service.
- * private final ConcurrentInitializer<MessagingService> initializer;
+ * private final ConcurrentInitializer<MessagingService> initializer;
*
- * public ServerThread(ConcurrentInitializer<MessagingService> init) {
+ * public ServerThread(ConcurrentInitializer<MessagingService> init) {
* initializer = init;
* }
*
@@ -115,7 +112,7 @@
* }
* }
* }
- * </code>
+ * }
* </pre>
*
* <p>
@@ -125,7 +122,7 @@
* {@link org.apache.commons.lang3.concurrent.AtomicInitializer#initialize()
initialize()} method which has to be
* implemented by concrete subclasses in order to create and initialize the
managed object. Actually, in our example
* above we can turn the {@code MessagingServiceInitializer} into an atomic
initializer by simply changing the
- * <strong>extends</strong> declaration to refer to {@code
AtomicInitializer<MessagingService>} as super class.
+ * <strong>extends</strong> declaration to refer to {@code
AtomicInitializer<MessagingService>} as super class.
* </p>
*
* <p>
@@ -178,9 +175,8 @@
* this purpose:
* </p>
*
- * <pre>
- * <code>
- * public class URLLoader extends BackgroundInitializer<String> {
+ * <pre>{@code
+ * public class URLLoader extends BackgroundInitializer<String> {
* // The URL to be loaded.
* private final URL url;
*
@@ -199,7 +195,7 @@
* }
* }
* }
- * </code>
+ * }
* </pre>
*
* <p>
@@ -252,7 +248,7 @@
* </p>
*
* <pre>
- * <code>
+ * {@code
* MultiBackgroundInitializer initializer = new MultiBackgroundInitializer();
* initializer.addInitializer("url", new URLLoader(url));
* initializer.addInitializer("jpa", new JPAEMFInitializer());
@@ -268,7 +264,7 @@
* EntityManagerFactory emf =
* (EntityManagerFactory) results.getResultObject("jpa");
* ...
- * </code>
+ * }
* </pre>
*
* <p>
@@ -327,16 +323,15 @@
* {@link org.apache.commons.lang3.concurrent.ConcurrentException} ignoring
unchecked exceptions:
* </p>
*
- * <pre>
- * <code>
- * Future<Object> future = ...;
+ * <pre>{@code
+ * Future<Object> future = ...;
* try {
* Object result = future.get();
* ...
* } catch (ExecutionException eex) {
* ConcurrentUtils.handleCause(eex);
* }
- * </code>
+ * }
* </pre>
*
* <p>
@@ -350,16 +345,15 @@
* looks as follows:
* </p>
*
- * <pre>
- * <code>
- * ConcurrentInitializer<MyClass> initializer = ...;
+ * <pre>{@code
+ * ConcurrentInitializer<MyClass> initializer = ...;
* try {
* MyClass obj = initializer.get();
* // do something with obj
* } catch (ConcurrentException cex) {
* // exception handling
* }
- * </code>
+ * }
* </pre>
*
* <p>
@@ -368,11 +362,11 @@
* </p>
*
* <pre>
- * <code>
- * ConcurrentInitializer<MyClass> initializer = ...;
+ * {@code
+ * ConcurrentInitializer<MyClass> initializer = ...;
* MyClass obj = ConcurrentUtils.initializeUnchecked(initializer);
* // do something with obj
- * </code>
+ * }
* </pre>
*
* <p>
@@ -394,14 +388,14 @@
* </p>
*
* <pre>
- * <code>
+ * {@code
* BasicThreadFactory factory = new BasicThreadFactory.Builder()
* .namingPattern("worker-thread-%d")
* .daemon(true)
* .uncaughtExceptionHandler(myHandler)
* .build();
* ExecutorService exec = Executors.newSingleThreadExecutor(factory);
- * </code>
+ * }
* </pre>
*
* <p>
diff --git
a/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
b/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
index 08be680e7..349316e0e 100644
--- a/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
+++ b/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
@@ -46,10 +46,10 @@ import org.apache.commons.lang3.function.FailableConsumer;
* <p>
* To use this class, suppose you want to support ActionEvents. You would do:
* </p>
- * <pre><code>
+ * <pre>{@code
* public class MyActionEventSource
* {
- * private EventListenerSupport<ActionListener> actionListeners =
+ * private EventListenerSupport<ActionListener> actionListeners =
* EventListenerSupport.create(ActionListener.class);
*
* public void someMethodThatFiresAction()
@@ -58,7 +58,7 @@ import org.apache.commons.lang3.function.FailableConsumer;
* actionListeners.fire().actionPerformed(e);
* }
* }
- * </code></pre>
+ * }</pre>
*
* <p>
* Serializing an {@link EventListenerSupport} instance will result in any
diff --git a/src/main/java/org/apache/commons/lang3/function/Failable.java
b/src/main/java/org/apache/commons/lang3/function/Failable.java
index e127a83f4..ebffe7266 100644
--- a/src/main/java/org/apache/commons/lang3/function/Failable.java
+++ b/src/main/java/org/apache/commons/lang3/function/Failable.java
@@ -42,14 +42,15 @@ import
org.apache.commons.lang3.stream.Streams.FailableStream;
* throw Exceptions, at least not checked Exceptions, AKA instances of {@link
Exception}. This enforces the use of
* constructs like:
*
- * <pre>
- * Consumer<java.lang.reflect.Method> consumer = m -> {
+ * <pre>{@code
+ * Consumer<java.lang.reflect.Method> consumer = m -> {
* try {
* m.invoke(o, args);
* } catch (Throwable t) {
* throw Failable.rethrow(t);
* }
* };
+ * }
* </pre>
*
* <p>
diff --git
a/src/main/java/org/apache/commons/lang3/function/MethodInvokers.java
b/src/main/java/org/apache/commons/lang3/function/MethodInvokers.java
index b90f0c14f..f29633027 100644
--- a/src/main/java/org/apache/commons/lang3/function/MethodInvokers.java
+++ b/src/main/java/org/apache/commons/lang3/function/MethodInvokers.java
@@ -44,11 +44,11 @@ import
org.apache.commons.lang3.exception.UncheckedIllegalAccessException;
* For example to invoke {@link String#length()}:
* </p>
*
- * <pre>
+ * <pre>{@code
* final Method method = String.class.getMethod("length");
- * final Function<String, Integer> function =
MethodInvokers.asFunction(method);
+ * final Function<String, Integer> function =
MethodInvokers.asFunction(method);
* assertEquals(3, function.apply("ABC"));
- * </pre>
+ * }</pre>
*
* <h2>Calling function methods with one argument</h2>
* <p>
@@ -60,11 +60,11 @@ import
org.apache.commons.lang3.exception.UncheckedIllegalAccessException;
* For example to invoke {@link String#charAt(int)}:
* </p>
*
- * <pre>
+ * <pre>{@code
* final Method method = String.class.getMethod("charAt", int.class);
- * final BiFunction<String, Integer, Character> function =
MethodInvokers.asBiFunction(method);
+ * final BiFunction<String, Integer, Character> function =
MethodInvokers.asBiFunction(method);
* assertEquals('C', function.apply("ABC", 2));
- * </pre>
+ * }</pre>
*
* @since 3.13.0
*/
@@ -93,11 +93,11 @@ public final class MethodInvokers {
* For example to invoke {@link String#charAt(int)}:
* </p>
*
- * <pre>
+ * <pre>{@code
* final Method method = String.class.getMethod("charAt", int.class);
- * final BiFunction<String, Integer, Character> function =
MethodInvokers.asBiFunction(method);
+ * final BiFunction<String, Integer, Character> function =
MethodInvokers.asBiFunction(method);
* assertEquals('C', function.apply("ABC", 2));
- * </pre>
+ * }</pre>
*
* @param <T> the type of the first argument to the function: The type
containing the method.
* @param <U> the type of the second argument to the function: the method
argument type.
@@ -178,11 +178,11 @@ public final class MethodInvokers {
* For example to invoke {@link String#length()}:
* </p>
*
- * <pre>
+ * <pre>{@code
* final Method method = String.class.getMethod("length");
- * final Function<String, Integer> function =
MethodInvokers.asFunction(method);
+ * final Function<String, Integer> function =
MethodInvokers.asFunction(method);
* assertEquals(3, function.apply("ABC"));
- * </pre>
+ * }</pre>
*
* @param <T> the type of the first argument to the function: The type
containing the method.
* @param <R> the type of the result of the function: The method return
type.
diff --git a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
index fe620c2de..5ffd3fbca 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
@@ -528,7 +528,7 @@ public class MethodUtils {
*
* @param method lowest to consider
* @param interfacesBehavior whether to search interfaces, {@code null}
{@code implies} false
- * @return Set<Method> in ascending order from sub- to superclass
+ * @return a {@code Set<Method>} in ascending order from sub- to superclass
* @throws NullPointerException if the specified method is {@code null}
* @since 3.2
*/
diff --git a/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java
b/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java
index 6513918a7..13f4a8265 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java
@@ -28,9 +28,10 @@ import org.apache.commons.lang3.Validate;
* passing the (non-parameterized) {@link Type} object itself. Consider:
* <p>
* You might see such a typesafe API as:
- * <pre>
+ * <pre>{@code
* class Typesafe {
- * <T> T obtain(Class<T> type, ...);
+ * <T> T obtain(Class<T> type, ...);
+ * }
* }
* </pre>
* Consumed in the manner of:
@@ -38,24 +39,24 @@ import org.apache.commons.lang3.Validate;
* Foo foo = typesafe.obtain(Foo.class, ...);
* </pre>
* Yet, you run into problems when you want to do this with a parameterized
type:
- * <pre>
- * List<String> listOfString = typesafe.obtain(List.class, ...); //
could only give us a raw List
- * </pre>
+ * <pre>{@code
+ * List<String> listOfString = typesafe.obtain(List.class, ...); // could only
give us a raw List
+ * }</pre>
* {@link java.lang.reflect.Type} might provide some value:
- * <pre>
+ * <pre>{@code
* Type listOfStringType = ...; // firstly, how to obtain this? Doable, but
not straightforward.
- * List<String> listOfString = (List<String>)
typesafe.obtain(listOfStringType, ...); // nongeneric Type would necessitate a
cast
- * </pre>
+ * List<String> listOfString = (List<String>)
typesafe.obtain(listOfStringType, ...); // nongeneric Type would necessitate a
cast
+ * }</pre>
* The "type literal" concept was introduced to provide an alternative, i.e.:
- * <pre>
+ * <pre>{@code
* class Typesafe {
- * <T> T obtain(TypeLiteral<T> type, ...);
+ * <T> T obtain(TypeLiteral<T> type, ...);
* }
- * </pre>
+ * }</pre>
* Consuming code looks like:
- * <pre>
- * List<String> listOfString = typesafe.obtain(new
TypeLiteral<List<String>>() {}, ...);
- * </pre>
+ * <pre>{@code
+ * List<String> listOfString = typesafe.obtain(new TypeLiteral<List<String>>()
{}, ...);
+ * }</pre>
* <p>
* This has the effect of "jumping up" a level to tie a {@link
java.lang.reflect.Type}
* to a type variable while simultaneously making it short work to obtain a
@@ -65,9 +66,9 @@ import org.apache.commons.lang3.Validate;
* is a generalization of this concept, and which may be implemented in custom
classes.
* It is suggested that APIs be defined in terms of the interface, in the
following manner:
* </p>
- * <pre>
- * <T> T obtain(Typed<T> typed, ...);
- * </pre>
+ * <pre>{@code
+ * <T> T obtain(Typed<T> typed, ...);
+ * }</pre>
*
* @param <T> the type
* @since 3.2
diff --git a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
index 21b583e8f..041459bf1 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
@@ -1436,18 +1436,17 @@ public class TypeUtils {
* Example, with the variable type declaration:
* </p>
*
- * <pre>
- * <K extends java.util.Collection<String> &
- * java.util.List<String>>
- * </pre>
+ * <pre>{@code
+ * <K extends java.util.Collection<String> & java.util.List<String>>
+ * }</pre>
*
* <p>
* since {@link List} is a subinterface of {@link Collection}, this method
will return the bounds as if the declaration had been:
* </p>
*
- * <pre>
- * <K extends java.util.List<String>>
- * </pre>
+ * <pre>{@code
+ * <K extends java.util.List<String>>
+ * }</pre>
*
* @param bounds an array of types representing the upper bounds of either
{@link WildcardType} or {@link TypeVariable}, not {@code null}.
* @return an array containing the values from {@code bounds} minus the
redundant types.
@@ -1823,7 +1822,7 @@ public class TypeUtils {
*
* @param <T> generic type
* @param type to wrap
- * @return Typed<T>
+ * @return {@code Typed<T>}
* @since 3.2
*/
public static <T> Typed<T> wrap(final Class<T> type) {
@@ -1835,7 +1834,7 @@ public class TypeUtils {
*
* @param <T> inferred generic type
* @param type to wrap
- * @return Typed<T>
+ * @return {@code Typed<T>}
* @since 3.2
*/
public static <T> Typed<T> wrap(final Type type) {
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
b/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
index 8b8a03d0b..78b9f41d1 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
@@ -38,9 +38,9 @@ import java.util.TimeZone;
* </p>
*
* <p>Since FastDateFormat is thread safe, you can use a static member
instance:</p>
- * <code>
+ * {@code
* private static final FastDateFormat DATE_FORMATTER =
FastDateFormat.getDateTimeInstance(FastDateFormat.LONG, FastDateFormat.SHORT);
- * </code>
+ * }
*
* <p>This class can be used as a direct replacement to
* {@link SimpleDateFormat} in most formatting and parsing situations.
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
index c87abe936..893e6645f 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
@@ -54,9 +54,9 @@ import org.apache.commons.lang3.LocaleUtils;
* <p>
* Since FastDateParser is thread safe, you can use a static member instance:
* </p>
- * <code>
+ * {@code
* private static final DateParser DATE_PARSER =
FastDateFormat.getInstance("yyyy-MM-dd");
- * </code>
+ * }
*
* <p>
* This class can be used as a direct replacement for {@link SimpleDateFormat}
in most parsing situations. This class is especially useful in multi-threaded
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
index 1be4e644c..c258e8558 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
@@ -44,9 +44,9 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
* or another variation of the factory methods of {@link FastDateFormat}.</p>
*
* <p>Since FastDatePrinter is thread safe, you can use a static member
instance:</p>
- * <code>
+ * {@code
* private static final DatePrinter DATE_PRINTER =
FastDateFormat.getInstance("yyyy-MM-dd");
- * </code>
+ * }
*
* <p>This class can be used as a direct replacement to
* {@link SimpleDateFormat} in most formatting situations.