Skip to content

Commit

Permalink
Fix grammar, style, and spelling errors flagged by IntelliJ
Browse files Browse the repository at this point in the history
  • Loading branch information
sleberknight committed Dec 24, 2024
1 parent 393fad5 commit 6cea80d
Show file tree
Hide file tree
Showing 48 changed files with 96 additions and 96 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In general, we look first to either Google Guava or Apache Commons for utilities
we need, or if what they have isn't exactly what we want, then we'll (probably) add it here.

Almost all the dependencies in the POM have _provided_ scope, so that we don't bring in a ton of required dependencies.
This downside to this is that you must specifically add any required dependencies to your own POM in order to use a
This downside to this is that you must specifically add any required dependencies to your own POM to use a
specific feature in Kiwi.

The only required dependencies are guava, commons-lang3, and slf4j-api. If you use the Maven Enforcer plugin, you could therefore
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
The mongo driver to use is optional in Spring Data's POM.
You have to choose either the mongodb-driver-sync
or the mongodb-driver-reactivestreams as the driver.
The mongodb-driver-core is required by both of them.
Both of them require the mongodb-driver-core.
-->
<dependency>
<groupId>org.mongodb</groupId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kiwiproject/base/KiwiDeprecated.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
String since() default "";

/**
* The anticipated version at which the annotated element will be removed.
* The upcoming version at which the annotated element will be removed.
*
* @return the anticipated version when the annotated element will be removed
* @return the upcoming version when the annotated element will be removed
*/
String removeAt() default "";

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kiwiproject/base/KiwiEnums.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static <E extends Enum<E>> Optional<E> getIfPresentIgnoreCase(Class<E> en
return Optional.empty();
}

// First try the value as-is, then fallback to the value with leading & trailing whitespace stripped
// First try the value as-is, then fallback to the value with leading and trailing whitespace stripped
return Optional.ofNullable(EnumUtils.getEnumIgnoreCase(enumClass, value))
.or(() -> Optional.ofNullable(EnumUtils.getEnumIgnoreCase(enumClass, value.strip())));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kiwiproject/base/KiwiEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public interface KiwiEnvironment {

/**
* Returns the process ID of the currently executing JVM. This method does not perform any error checking. Use
* {@link #tryGetCurrentPid()} for a version that returns an empty optional if it is unable to obtain the pid
* {@link #tryGetCurrentPid()} for a version that returns an empty optional if it is unable to get the pid
* for any reason.
*
* @return the pid of the current process
Expand All @@ -173,7 +173,7 @@ public interface KiwiEnvironment {
long currentPid();

/**
* Tries to obtain the process ID of the currently executing JVM. If any problem occurs, it is caught and an
* Tries to get the process ID of the currently executing JVM. If any problem occurs, it is caught and an
* empty optional is returned.
*
* @return an optional containing the pid of the current process, or empty if <em>any</em> problem occurred
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kiwiproject/base/KiwiStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public static String blankToNull(String sequence) {
* and the resulting message will thus be very difficult to understand, as there will be more arguments than
* {@code %s} placeholders.
* <p>
* Generally you should pick one style and be consistent throughout your entire application. Since originally this
* Generally, you should pick one style and be consistent throughout your entire application. Since originally this
* method only supported the Guava {@code %s}, this support was retained for obvious backward-compatibility reasons,
* and the SLF4J {@code {}} style as added because we kept coming across instances where people are used to SLF4J
* replacement parameter style and used that, thus making the message not interpolate correctly (though thanks to
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kiwiproject/base/KiwiThrowables.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static Optional<String> messageOfNullable(@Nullable Throwable throwable)

/**
* Simply wraps the Apache Commons' {@link ExceptionUtils#getStackTrace(Throwable)} method. Mainly here to make it
* easy to obtain a stack trace while staying in the same {@link KiwiThrowables} API.
* easy to get a stack trace while staying in the same {@link KiwiThrowables} API.
*
* @param throwable the {@link Throwable} instance
* @return the stack trace of the {@code throwable}, or {@code null}
Expand All @@ -267,7 +267,7 @@ public static String stackTraceOf(Throwable throwable) {

/**
* Simply wraps the Apache Commons' {@link ExceptionUtils#getStackTrace(Throwable)} method. Mainly here to make it
* easy to obtain a stack trace while staying in the same {@link KiwiThrowables} API.
* easy to get a stack trace while staying in the same {@link KiwiThrowables} API.
*
* @param throwable the {@link Throwable} instance
* @return the stack trace of the {@code throwable}, or {@code null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public int kill(long processId, String signal, long timeout, TimeUnit unit, Kill
}

/**
* Equivalent to a {@code kill -9} (i.e. a {@code SIGKILL}).
* Equivalent to a {@code kill -9} (i.e., a {@code SIGKILL}).
*
* @param process the process to kill forcibly
* @param timeout the time to wait for the process to be forcibly killed
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/kiwiproject/base/process/Processes.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class Processes {
* CentOS/Red Hat 6 and 7. Specifically, some systems require {@code -fl} to match against and print out the full
* command line with {@code pgrep}. Other implementations require {@code -fa} (or {@code -f --list-full}).
* <p>
* See for example <a href="http://man7.org/linux/man-pages/man1/pgrep.1.html">Linux pgrep</a> and
* See, for example, <a href="http://man7.org/linux/man-pages/man1/pgrep.1.html">Linux pgrep</a> and
* <a href="https://www.freebsd.org/cgi/man.cgi?query=pgrep&sektion=1">BSD pgrep</a> for more information.
*/
private static final String PGREP_FULL_COMMAND_MATCH_AND_PRINT_FLAGS;
Expand Down Expand Up @@ -205,7 +205,7 @@ public static String getPgrepFlags() {
* to obtain Process pids, but since JDK 9 offers the {@link Process#pid()} method, that is no longer necessary.
* This method is now a simple delegation to {@link Process#pid()} and you should now prefer that method.</em>
*
* @param process the process to obtain the process id (pid) from
* @param process the process to get the process id (pid) from
* @return the process id of {@code process}
* @throws UnsupportedOperationException if the Process implementation does not support getting the pid
* @see Process#pid()
Expand All @@ -219,7 +219,7 @@ public static long processId(Process process) {
* Get a process id, or "pid", if it is available from the {@link Process} implementation, wrapped inside
* an OptionalLong. If the pid is not available for whatever reason, return an empty OptionalLong.
*
* @param process the process to obtain the process id (pid) from
* @param process the process to get the process id (pid) from
* @return an OptionalLong containing the process if of {@code process} or an empty OptionalLong if the
* {@link Process} implementation does not support getting the pid for whatever reason.
* @implNote the {@link Process#pid()} method says it can throw {@link UnsupportedOperationException} if the
Expand Down Expand Up @@ -617,7 +617,7 @@ private static Process launchProcessInternal(@Nullable File workingDirectory,
}

/**
* Equivalent to a {@code kill -9} (i.e. a {@code SIGKILL}).
* Equivalent to a {@code kill -9} (i.e., a {@code SIGKILL}).
*
* @param process the process to kill forcibly
* @param timeout the time to wait for the process to be forcibly killed
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kiwiproject/collect/KiwiCollections.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static <T> Optional<T> lastIfPresent(Collection<T> sequencedCollection) {
* @param <T> the type of elements in the collection
* @return the last element of the collection
* @throws IllegalArgumentException if sequencedCollection is null, empty, or not a sequenced collection
* @implNote If {@code sequencedCollection} is a {@link LinkedHashSet}, there is no direct way to obtain the
* @implNote If {@code sequencedCollection} is a {@link LinkedHashSet}, there is no direct way to get the
* last element. This implementation creates a {@link java.util.stream.Stream Stream} over the elements, skipping
* until the last element.
* @see #isSequenced(Collection)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kiwiproject/collect/KiwiLists.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public static <T> List<T> subListFromIndex(List<T> items, int index) {
}

/**
* Returns a view of the "first N" elements of the input list.
* Returns a view of the "first N" elements from the input list.
* <p>
* If the given number is larger than the size of the list, the entire list is returned, rather than throw
* an exception. In this case, the input list is returned directly, i.e. {@code return items}.
Expand All @@ -386,7 +386,7 @@ public static <T> List<T> firstN(List<T> items, int number) {
}

/**
* Returns a view of the "last N" elements of the input list.
* Returns a view of the "last N" elements from the input list.
* <p>
* If the given number is larger than the size of the list, the entire list is returned, rather than throw
* an exception. In this case, the input list is returned directly, i.e. {@code return items}.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kiwiproject/collect/KiwiProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static Properties newProperties(Map<String, String> map) {

/**
* Creates a <i>mutable</i> {@link Properties} instance from each key/value pair list inside the outer list.
* The {@code items} argument must contain keys and values in teh form:
* The {@code items} argument must contain keys and values in the form:
* <p>
* <i>[ [key-1, value-1], [key-2, value-2], ... , [key-N, value-N]</i>
* </p>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kiwiproject/collect/KiwiStreams.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public final class KiwiStreams {
/**
* Find the first object having the given {@code typeToFind} in a stream of objects.
*
* @param stream the stream of objects of some (unknown) type
* @param stream the stream of objects containing some (unknown) type
* @param typeToFind the class of the object to find
* @param <T> the type token of the type we want to find
* @return an Optional containing the first object of the given type, or empty
Expand All @@ -32,7 +32,7 @@ public static <T> Optional<T> findFirst(Stream<?> stream, Class<T> typeToFind) {
* Find the first object having the given {@code typeToFind} and matching the supplied
* predicate in a stream of objects.
*
* @param stream the stream of objects of some (unknown) type
* @param stream the stream of objects containing some (unknown) type
* @param typeToFind the class of the object to find
* @param predicate the condition that must be satisfied for a match to occur
* @param <T> the type token of the type we want to find
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public static Builder builder() {
* Convert this instance to a new {@link SSLContext}.
* <p>
* If you would rather not create a new instance every time, use {@link #toSimpleSSLContextFactory()}
* to obtain a factory that will always return the same {@link SSLContext} instance.
* to get a factory that will always return the same {@link SSLContext} instance.
*
* @return a new {@link SSLContext} instance
* @implNote This will always create a new instance, first creating a new {@link SimpleSSLContextFactory}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public boolean anyEndpointSecure() {
}

/**
* Returns true if <strong>all</strong> of the endpoints in this configuration are secure.
* Returns true if <strong>all</strong> the endpoints in this configuration are secure.
*
* @return {@code true} if all endpoints are secure: {@code false} otherwise
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* As this is a configuration class generally intended to be populated from external configuration, it is mutable and
* supports construction in a variety of ways - no argument constructor and setter methods, all-arguments
* constructor, or a builder. Once constructed, it is intended to be read-only, though this cannot be enforced
* and still have setter methods.
* and still have "setter" methods.
*/
@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class KiwiDropwizardLifecycles {
* <p>
* Useful when you have some external object that has start and stop methods, but you don't want to clutter your
* code by creating an anonymous inner class just to specify the start and stop actions. For example, if you have
* an ActiveMQ {@code PooledConnectionFactory} (which has {@code start} and {@code stop} methods) you can simply
* an ActiveMQ {@code PooledConnectionFactory} (which has {@code start} and {@code stop} methods) you can
* call this method:
* <p>
* {@code KiwiDropwizardLifecycles.manage(lifecycle, () -> factory.start(), () -> factory.stop());}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ public static Optional<JacksonDataFormat> detectFormat(String text, Charset char
* Detect the data format of given text using given {@link Charset} and {@link DataFormatDetector}.
* <p>
* This method is an "escape hatch"; it allows detection of formats not supported in {@link JacksonDataFormat}
* since it accepts a {@link DataFormatDetector} and it returns a String. Thus, since the caller supplies its own
* custom {@link DataFormatDetector}, the formats that are supported are dictated entirely by that caller. And
* since it accepts a {@link DataFormatDetector} and it returns a String. Since the caller supplies its own
* custom {@link DataFormatDetector}, that caller dictates the formats that are supported. And
* because it returns a String, it is not limited to the formats defined in the {@link JacksonDataFormat} enum.
*
* @param text the String value to check
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kiwiproject/jaxrs/KiwiMultivaluedMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class KiwiMultivaluedMaps {
* Create a new {@link MultivaluedMap} from the given items, which are expected to be in alternating
* key/value pairs. This allows for keys to be repeated, i.e., so that a single key can have multiple values.
*
* @param items the keys and values, e.g. key1, value1, key2, value2, ...
* @param items the keys and values, e.g., key1, value1, key2, value2, ...
* @return a new {@link MultivaluedMap}
* @implNote the actual type returned is currently a {@link MultivaluedHashMap}
*/
Expand All @@ -45,7 +45,7 @@ public static MultivaluedMap<String, String> newMultivaluedMap(String... items)
* one value per key, even if {@code items} contains multiple values per key. In that case, the <em>last</em>
* value in {@code items} associated with a given key is the one that "wins" and stays in the returned map.
*
* @param items the keys and values, e.g. key1, value1, key2, value2, ...
* @param items the keys and values, e.g., key1, value1, key2, value2, ...
* @return a new {@link MultivaluedMap}
* @implNote the actual type returned is currently a {@link MultivaluedHashMap}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public <V> WebTargetHelper queryParamsFromMap(Map<String, V> parameters) {
// more difficult to understand than a simple loop with a mutable variable that we keep replacing. In addition,
// the "reduce" version cannot be strictly correct, since we cannot define a combiner function which is "an
// associative, non-interfering, stateless function for combining" two WebTargetHelper instances. Instead, we
// would require it is only used on a sequential (non-parallel) stream. Regardless, the implementation is less
// would require it be only used on a sequential (non-parallel) stream. Regardless, the implementation is less
// clear than just a loop with a mutable variable, which is why this is not using the streams API. While the
// lovely StreamEx library does have a foldLeft where the seed and accumulator have differing types, it is not
// worth adding a hard dependency on that library for one function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public List<ErrorMessage> getErrors() {
/**
* Change the {@link ErrorMessage} objects contained in this exception.
* <p>
* <strong>NOTE:</strong> If the given {@code errorMessages} is null or empty, it is ignored in order to
* <strong>NOTE:</strong> If the given {@code errorMessages} is null or empty, it is ignored to
* prevent clearing out all errors.
*
* @param errorMessages the new {@link ErrorMessage}s to set
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kiwiproject/jsch/JSchSlf4jLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Some implementation notes:
* <ul>
* <li>JSch's INFO level logging is very verbose, so we are treating it like DEBUG level</li>
* <li>Jsch has both ERROR and FATAL levels, but SLF4J only has ERROR, so we treat both as ERROR in SLF4J</li>
* <li>Jsch has both ERROR and FATAL levels, but SLF4J only has ERROR, so we treat both of them as ERROR in SLF4J</li>
* </ul>
*/
public class JSchSlf4jLogger implements com.jcraft.jsch.Logger {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/kiwiproject/json/FlexibleJsonModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* {@link JsonAnyGetter} and {@link JsonAnySetter} feature to get and set these "extra fields" in a property
* named {@code extraFields}.
* <p>
* The general use case for this "extra fields" is when a service or application proxies data from a canonical source
* where we don't want or need to know about every individual field, but where we still want to capture those fields,
* The general use case for this "extra fields" is when some service or application proxies data from a canonical source
* where we don't want or need to know about every field, but where we still want to capture those fields,
* so we can store, display, etc. them. For example, a remote service that has a large number of properties, and
* we only care about a few of them, but we might want to store all of them for analytics, debugging, etc.
* <p>
Expand All @@ -30,7 +30,7 @@ public abstract class FlexibleJsonModel {
protected final Map<String, Object> extraFields = new HashMap<>();

/**
* Returns the "extra" fields that were not explicitly defined as properties when this object was deserialized
* Returns the "extra" fields not explicitly defined as properties when this object was deserialized
* from JSON.
*
* @return the extra fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* <p>
* NOTE: Generally masking should be used only on String fields, because otherwise the type in the resulting JSON will
* be different from the source type. For example, if a class has a "secretNumber" of type "int" and it is masked, the
* resulting JSON contains a String instead of an int, which will likely cause problems if a downstream system reads
* resulting JSON contains a String instead of an int. This will likely cause problems if a downstream system reads
* the JSON expecting an int. For such cases, consider using {@link com.fasterxml.jackson.annotation.JsonView} instead.
* <p>
* Note that jackson-core and jackson-databind must be available at runtime.
Expand Down
Loading

0 comments on commit 6cea80d

Please sign in to comment.