Skip to content

Commit

Permalink
Apply grammar suggestions from the IntelliJ linter (#9469)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhowe authored Nov 25, 2024
1 parent 1731d66 commit 2d11113
Show file tree
Hide file tree
Showing 38 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mailing list beforehand.
* Add the release notes to `docs/source/about/release-notes.rst` and set the release date;
* Add the link to the documentation to `docs/source/about/docs-index.rst` if it's a new major or minor version;
* Run `./mvnw release:prepare` in the master branch;
* This will set the version of all Maven sub-modules and run the tests one last time before pushing the tagged commit which will trigger the release build on Travis CI;
* This will set the version of all Maven submodules and run the tests one last time before pushing the tagged commit which will trigger the release build on Travis CI;
* Observe that all tests passed, there is no build errors and the corresponding git tag was created;
* Create the release notes in GitHub: [Creating releases](https://help.github.com/en/articles/creating-releases);
* The release will typically be available in the Maven Central repository 3-4 hours after the artifacts were pushed to Sonatype OSSRH (this may vary depending on the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public T buildAuthFilter() {
}

/**
* Authenticates a request with user credentials and setup the security context.
* Authenticates a request with user credentials and set up the security context.
*
* @param requestContext the context of the request
* @param credentials the user credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public JerseyClientBuilder using(ObjectMapper objectMapper) {

/**
* Use the given {@link ConnectorProvider} instance.
* <p/><b>WARNING:</b> Use it with a caution. Most of features will not
* work in a custom connection provider.
* <p/><b>WARNING:</b> Use it with caution. Most features will not work in
* a custom connection provider.
*
* @param connectorProvider a {@link ConnectorProvider} instance
* @return {@code this}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface ConfigurationFactory<T> {
/**
* Loads, parses, binds, and validates a configuration object.
*
* @param provider the provider to to use for reading configuration files
* @param provider the provider to use for reading configuration files
* @param path the path of the configuration file
* @return a validated configuration object
* @throws IOException if there is an error reading the file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void optionalProperty(BeanProperty prop) throws JsonMappingException {
currentPrefix = oldPrefix;
}

// if no new fields are discovered, we assume that we are at an primitive field
// if no new fields are discovered, we assume that we are at a primitive field
if (oldFieldSize == fields.size()) {
fields.put(name, prop.getType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class LevenshteinComparatorTest {
private final ConfigurationParsingException.Builder.LevenshteinComparator c = new ConfigurationParsingException.Builder.LevenshteinComparator("base");

/**
* An "java.lang.IllegalArgumentException: Comparison method violates its general contract!"
* An {@link IllegalArgumentException} "Comparison method violates its general contract!"
* is triggered by this test with a previous version of LevenshteinComparator
* <p>
* It is triggered by a certain condition in TimSort that only happens if 32 or more
Expand All @@ -38,5 +38,4 @@ void testLevenshteinCompare() {
assertThat(c.compare("b", "v")).isEqualTo(-1);
assertThat(c.compare("v", "b")).isEqualTo(1);
}

}
4 changes: 2 additions & 2 deletions dropwizard-core/src/main/java/io/dropwizard/core/cli/Cli.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Cli {
private final ArgumentParser parser;

/**
* Create a new CLI interface for a application and its bootstrapped environment.
* Create a new CLI interface for an application and its bootstrapped environment.
*
* @param location the location of the application
* @param bootstrap the bootstrap for the application
Expand Down Expand Up @@ -78,7 +78,7 @@ public Optional<Throwable> run(String... arguments) {
command.run(bootstrap, namespace);
} catch (Throwable e) {
// The command failed to run, and the command knows
// best how to cleanup / debug exception
// best how to clean up / debug exception
command.onError(this, namespace, e);
return Optional.of(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final String getDescription() {
/**
* Executes when the user runs this specific command.
*
* @param bootstrap the bootstrap bootstrap
* @param bootstrap the bootstrap
* @param namespace the parsed command line namespace
* @throws Exception if something goes wrong
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected void cleanup() {
/**
* Runs the command with the given {@link Bootstrap} and {@link Configuration}.
*
* @param bootstrap the bootstrap bootstrap
* @param bootstrap the bootstrap
* @param namespace the parsed command line namespace
* @param configuration the configuration object
* @throws Exception if something goes wrong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.slf4j.LoggerFactory;

/**
* Runs a application as an HTTP server.
* Runs an application as an HTTP server.
*
* @param <T> the {@link Configuration} subclass which is loaded from the configuration file
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.List;
import java.util.Map;

/** A task that will refresh all ssl factories with up to date certificate information */
/** A task that will refresh all ssl factories with up-to-date certificate information */
public class SslReloadTask extends Task {
private Collection<SslReload> reloader = Collections.emptySet();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void testSupportShouldResetLogging(@TempDir Path tempDir) throws Exception {

// Dropwizard test support resets configuration overrides if `before` throws an exception
// which is fine, as that would normally signal the end of the test, but since we're
// testing logging behavior that is setup in the application `run` method, we need
// testing logging behavior that is set up in the application `run` method, we need
// to ensure our log override is still present (it's removed again in `after`)
logOverride.addToSystemProperties();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private byte[] certBytes(int code, String content) throws Exception {
assertThat(conn.getErrorStream()).asString(UTF_8).contains(content);
}

// The certificates are self signed, so are the only cert in the chain.
// The certificates are self-signed, so are the only cert in the chain.
// Thus, we return the one and only certificate.
return conn.getServerCertificates()[0].getEncoded();
} finally {
Expand Down
4 changes: 2 additions & 2 deletions dropwizard-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Included with this application is an example of the optional DB API module. The
the features available in [Hibernate](http://hibernate.org/), along with demonstrating how these are used from within
Dropwizard.

This database example is comprised of the following classes:
This database example comprises the following classes:

* The `PersonDAO` illustrates using the Data Access Object pattern with assisting of Hibernate.

Expand All @@ -35,7 +35,7 @@ To test the example application run the following commands.
./mvnw package
cd dropwizard-example

* To setup the h2 database run.
* To set up the h2 database run.

java -jar target/dropwizard-example-$DW_VERSION.jar db migrate example.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.glassfish.jersey.media.multipart.MultiPartFeature;

/**
* A {@link ConfiguredBundle}, which enables the processing of multi-part form data by your application.
* A {@link ConfiguredBundle}, which enables the processing of multipart form data by your application.
*
* @see org.glassfish.jersey.media.multipart.MultiPartFeature
* @see <a href="https://jersey.java.net/documentation/latest/media.html#multipart">Jersey Multipart</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected Result check() throws IOException {

/**
* Performs a health check via TCP against an external dependency.
* By default uses the Java {@link Socket} API, but can be overridden to allow for different behavior.
* By default, uses the Java {@link Socket} API, but can be overridden to allow for different behavior.
*
* @param host the host to check.
* @param port the port to check.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected E persist(E entity) throws HibernateException {
* it is not guaranteed that the elements INSIDE the collection will be initialized/materialized.
*
* @param proxy a persistable object, proxy, persistent collection or {@code null}
* @throws HibernateException if we can't initialize the proxy at this time, eg. the {@link Session} was closed
* @throws HibernateException if we can't initialize the proxy at this time, e.g. the {@link Session} was closed
*/
protected <T> T initialize(T proxy) throws HibernateException {
if (!Hibernate.isInitialized(proxy)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public <T> T create(Class<T> clazz) {
}

/**
* Creates a new <b>@UnitOfWork</b> aware proxy of a class with an one-parameter constructor.
* Creates a new <b>@UnitOfWork</b> aware proxy of a class with a one-parameter constructor.
*
* @param clazz the specified class definition
* @param constructorParamType the type of the constructor parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public JsonDeserializer<?> findEnumDeserializer(Class<?> type,
// If the user configured to use `toString` method to deserialize enums
if (config.hasDeserializationFeatures(DeserializationFeature.READ_ENUMS_USING_TO_STRING.getMask()) ||
config.hasDeserializationFeatures(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL.getMask()) ||
// The presence of @JsonEnumDefaultValue will cause a fallback to the default, however lets short circuit here
// The presence of @JsonEnumDefaultValue will cause a fallback to the default, however let's short circuit here
config.hasDeserializationFeatures(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE.getMask())) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Jdbi build(Environment environment,
// Manage the data source that created this instance.
environment.lifecycle().manage(dataSource);

// Setup the required health checks.
// Set up the required health checks.
final Optional<String> validationQuery = configuration.getValidationQuery();
environment.healthChecks().register(name, new JdbiHealthCheck(
environment.getHealthCheckExecutorService(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* If set, adds a {@code Cache-Control} header to the response which indicates the response is
* immutable and should be kept in cache for as long as possible. (Technically, this corresponds
* to a {@code max-age} of one year.
* to a {@code max-age} of one year).
*
* @see #maxAge()
* @return {@code true} if the response should be considered immutable and cached indefinitely
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import static java.util.Objects.requireNonNull;

/**
* This class allows producing non-JSON responses for particular entities. For example, register a instance with the
* This class allows producing non-JSON responses for particular entities. For example, register an instance with the
* {@link ErrorMessage} entity and the TEXT_HTML MediaType to produce custom HTML error messages.
*
* @param <T> The entity type to handle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.concurrent.ThreadLocalRandom;

/**
* This class adds a "X-Request-Id" HTTP response header and logs the following
* This class adds an "X-Request-Id" HTTP response header and logs the following
* information: request method, request path, request ID, response status,
* response length (or -1 if not known).
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,23 @@ private static String calculatePrefix(ConstraintViolation<?> v, Invocable invoca
final Optional<String> entity = isRequestEntity(v, invocable);
if (entity.isPresent()) {
// A present entity means that the request body failed validation but
// if the request entity is simple (eg. byte[], String, etc), the entity
// if the request entity is simple (e.g. byte[], String, etc.), the entity
// string will be empty, so prepend a message about the request body
return entity.filter(e -> !e.isEmpty())
.orElse("The request body")
+ " ";
}

// Check if the violation occurred on a *Param annotation and if so,
// return a human friendly error (eg. "Query param xxx may not be null")
// return a human friendly error (e.g. "Query param xxx may not be null")
final Optional<String> memberName = getMemberName(v, invocable);
return memberName.map(s -> s + " ").orElseGet(() -> v.getPropertyPath() + " ");

}

/**
* Determines if constraint violation occurred in the request entity. If it did, return a client
* friendly string representation of where the error occurred (eg. "patient.name")
* friendly string representation of where the error occurred (e.g. "patient.name")
*/
public static Optional<String> isRequestEntity(ConstraintViolation<?> violation, Invocable invocable) {
final Path.Node parent = StreamSupport.stream(violation.getPropertyPath().spliterator(), false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public List<String> getParameterNames(Method method) {
}

/**
* Derives member's name and type from it's annotations
* Derives member name and type from its annotations
*/
public static Optional<String> getParameterNameFromAnnotations(Annotation[] memberAnnotations) {
for (Annotation a : memberAnnotations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.hibernate.validator.internal.engine.valueextraction.ValueExtractorDescriptor;

/**
* Let's the validator know that when validating a {@link NonEmptyStringParam} to validate the
* Lets the validator know that when validating a {@link NonEmptyStringParam} to validate the
* underlying value. This class is needed, temporarily, while Hibernate is not able to unwrap nested
* classes <a href="https://hibernate.atlassian.net/browse/HV-904"/>.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.hibernate.validator.internal.engine.valueextraction.ValueExtractorDescriptor;

/**
* Let's the validator know that when validating a class that is an {@link AbstractParam} to
* Lets the validator know that when validating a class that is an {@link AbstractParam} to
* validate the underlying value.
*
* @since 2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ protected ServerConnector buildConnector(Server server,
connector.setInheritChannel(inheritChannel);
// if we do not set the acceptQueueSize, when jetty
// creates the ServerSocket, it uses the default backlog of 50, and
// not the value from the OS. Therefore we set to the value
// not the value from the OS. Therefore we set to the value
// obtained from NetUtil, which will attempt to read the value from the OS.
// somaxconn setting
int actualAcceptQueueSize = Objects.requireNonNullElseGet(acceptQueueSize, NetUtil::getTcpBacklog);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void testCreateThrowableProxyConverter_Configured() {
assertThat(converter.convert(event))
.hasLineCount(18) // 2 messages and 8 lines of stack per throwable
.containsSubsequence("wrapp3d", "r00t") // the root is not first
.doesNotContain(packageFilter) // does not includes the excluded packages
.doesNotContain(packageFilter) // does not include the excluded packages
.containsPattern("\\[\\d+ skipped\\]"); // and contains no skipped lines
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void testGiveNoWarningAboutMaximumPoolSizeAndBoundedQueue() {
}

/**
* There should be no warning about using a Executors.newSingleThreadExecutor() equivalent
* There should be no warning about using an Executors.newSingleThreadExecutor() equivalent
* @see java.util.concurrent.Executors#newSingleThreadExecutor()
*/
@Test
Expand All @@ -83,7 +83,7 @@ void shouldNotWarnWhenSettingUpSingleThreadedPool() {
}

/**
* There should be no warning about using a Executors.newCachedThreadPool() equivalent
* There should be no warning about using an Executors.newCachedThreadPool() equivalent
* @see java.util.concurrent.Executors#newCachedThreadPool()
*/
@Test
Expand Down Expand Up @@ -167,7 +167,7 @@ void nameWithoutFormat(String format, String name) {
}

/**
* Tries to run 2 tasks that on the executor that rely on each others side-effect to complete. If they fail to
* Tries to run 2 tasks that on the executor that rely on each others side effect to complete. If they fail to
* complete within a short time then we can assume they are not running concurrently
* @param exe an executor to try to run 2 tasks on
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import jakarta.validation.constraints.NotEmpty;

/**
* An {@link AppenderFactory} implementation which provides an appender that writes events to an UDP socket.
* An {@link AppenderFactory} implementation which provides an appender that writes events to a UDP socket.
* <p/>
* <b>Configuration Parameters:</b>
* <table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static Stream<Arguments> data() {

/*
* case4: If include list is NOT empty and exclude list is NOT empty, only things not excluded
* and specifically included should show up. Excludes takes precedence.
* and specifically included should show up. Excludes take precedence.
*/
Arguments.of(INCLUDES, EXCLUDES, "inc", true, true, true, "case4"),
Arguments.of(INCLUDES, EXCLUDES, "both", false, false, false, "case4"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void testFastForwardAll() throws Exception {
// Fast-forward all the changes
fastForwardCommand.run(null, new Namespace(Map.of("all", true, "dry-run", false)), conf);

// No migrations is performed
// No migrations are performed
new DbMigrateCommand<>(
TestMigrationConfiguration::getDataSource, TestMigrationConfiguration.class, "migrations.xml")
.run(null, new Namespace(Map.of()), conf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* A service provider interface for creating a Jetty {@link RequestLog}
*
* @param <T> type of a {@link RequestLog} implementation
* @param <T> type of {@link RequestLog} implementation
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = LogbackAccessRequestLogFactory.class)
public interface RequestLogFactory<T extends RequestLog> extends Discoverable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

/**
* A servlet which provides access to administrative {@link Task}s. It only responds to {@code POST}
* requests, since most {@link Task}s aren't side-effect free, and passes along the query string
* requests, since most {@link Task}s aren't side effect free, and passes along the query string
* parameters of the request to the task as a multimap.
*
* @see Task
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public DAOTestExtension build() {

/**
* Creates a new builder for {@link DAOTestExtension}, which allows to customize a {@link SessionFactory}
* by different parameters. By default uses the H2 database in the memory mode.
* by different parameters. Uses the H2 database in memory mode by default.
*
* @return a new {@link DAOTestExtension.Builder}
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.dropwizard.testing.junit5;

/**
* {@link DropwizardExtensionsSupport} class uses this interface to find fields fields in test class instance and test
* {@link DropwizardExtensionsSupport} class uses this interface to find fields in test class instance and test
* class
*/
public interface DropwizardExtension {
Expand Down
Loading

0 comments on commit 2d11113

Please sign in to comment.