Minor grammar fixes (#1143)

* style: minor grammar fixes

* revert: fix shadowed generic type in assertion

Will address this type of issue elsewhere in a separate PR.
This commit is contained in:
Paranoïd User 2023-12-07 08:42:22 -05:00 committed by GitHub
parent 68fdc0dd67
commit d3f8fdf126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 40 additions and 40 deletions

View File

@ -97,7 +97,7 @@ public class BackgroundInitializer<T> extends AbstractConcurrentInitializer<T, E
public static class Builder<I extends BackgroundInitializer<T>, T> extends AbstractBuilder<I, T, Builder<I, T>, Exception> {
/**
* The external executor service for executing tasks. null is an permitted value.
* The external executor service for executing tasks. null is a permitted value.
*/
private ExecutorService externalExecutor;
@ -108,7 +108,7 @@ public class BackgroundInitializer<T> extends AbstractConcurrentInitializer<T, E
}
/**
* Sets the external executor service for executing tasks. null is an permitted value.
* Sets the external executor service for executing tasks. null is a permitted value.
*
* @see org.apache.commons.lang3.concurrent.BackgroundInitializer#setExternalExecutor(ExecutorService)
*

View File

@ -88,7 +88,7 @@ public class LazyInitializer<T> extends AbstractConcurrentInitializer<T, Concurr
}
/**
* A unique value indicating an un-initialzed instance.
* A unique value indicating an un-initialized instance.
*/
private static final Object NO_INIT = new Object();

View File

@ -45,7 +45,7 @@ public class ArrayUtilsSetTest extends AbstractLangTest {
}
@Test
public void testSetAll_Suppiler() {
public void testSetAll_Supplier() {
final Supplier<?> nullSupplier = null;
assertNull(ArrayUtils.setAll(null, nullSupplier));
assertArrayEquals(null, ArrayUtils.setAll(null, nullSupplier));

View File

@ -137,14 +137,14 @@ public class ValidateTest extends AbstractLangTest {
}
@Test
void shouldThrowIllegalArgumentExcdeptionWhenValueIsLowerBound() {
void shouldThrowIllegalArgumentExceptionWhenValueIsLowerBound() {
final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
() -> Validate.exclusiveBetween(LOWER_BOUND, UPPER_BOUND, LOWER_BOUND, "MSG"));
assertEquals("MSG", ex.getMessage());
}
@Test
void shouldThrowIllegalArgumentExcdeptionWhenValueIsUpperBound() {
void shouldThrowIllegalArgumentExceptionWhenValueIsUpperBound() {
final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
() -> Validate.exclusiveBetween(LOWER_BOUND, UPPER_BOUND, UPPER_BOUND, "MSG"));
assertEquals("MSG", ex.getMessage());
@ -173,14 +173,14 @@ public class ValidateTest extends AbstractLangTest {
}
@Test
void shouldThrowIllegalArgumentExcdeptionWhenValueIsLowerBound() {
void shouldThrowIllegalArgumentExceptionWhenValueIsLowerBound() {
final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
() -> Validate.exclusiveBetween(LOWER_BOUND, UPPER_BOUND, LOWER_BOUND));
assertEquals("The value 0.1 is not in the specified exclusive range of 0.1 to 3.1", ex.getMessage());
}
@Test
void shouldThrowIllegalArgumentExcdeptionWhenValueIsUpperBound() {
void shouldThrowIllegalArgumentExceptionWhenValueIsUpperBound() {
final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
() -> Validate.exclusiveBetween(LOWER_BOUND, UPPER_BOUND, UPPER_BOUND));
assertEquals("The value 3.1 is not in the specified exclusive range of 0.1 to 3.1", ex.getMessage());
@ -581,7 +581,7 @@ public class ValidateTest extends AbstractLangTest {
}
@Test
void shouldThrowIllegalArgumentExceptionWithGiventMessageWhenClassIsNotAssignable() {
void shouldThrowIllegalArgumentExceptionWithGivenMessageWhenClassIsNotAssignable() {
final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
() -> Validate.isAssignableFrom(List.class, String.class, "MSG"));
assertEquals("MSG", ex.getMessage());
@ -1358,7 +1358,7 @@ public class ValidateTest extends AbstractLangTest {
}
@Test
void instancesCanBeConstrcuted() {
void instancesCanBeConstructed() {
assertNotNull(new Validate());
}

View File

@ -114,7 +114,7 @@ public class ReflectionDiffBuilderTest extends AbstractLangTest {
}
@Test
public void test_no_differences_diff_exluded_field_and_exclude_annotated_field() {
public void test_no_differences_diff_excluded_field_and_exclude_annotated_field() {
final TypeTestClass firstObject = new TypeTestClass();
firstObject.excludedField = "b";
firstObject.annotatedField = "b";

View File

@ -275,7 +275,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendBooleanArrayWithFieldNameAndFullDetatil() {
public void testAppendBooleanArrayWithFieldNameAndFullDetail() {
final boolean[] array = { true, false, false };
assertEquals(baseStr + "[flags={true,false,false}]",
new ToStringBuilder(base).append("flags", array, true).toString());
@ -300,7 +300,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendByteArrayWithFieldNameAndFullDetatil() {
public void testAppendByteArrayWithFieldNameAndFullDetail() {
final byte[] array = { 1, 2, -3, 4 };
assertEquals(baseStr + "[values={1,2,-3,4}]",
new ToStringBuilder(base).append("values", array, true).toString());
@ -324,7 +324,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendCharArrayWithFieldNameAndFullDetatil() {
public void testAppendCharArrayWithFieldNameAndFullDetail() {
final char[] array = { 'A', '2', '_', 'D' };
assertEquals(baseStr + "[chars={A,2,_,D}]", new ToStringBuilder(base).append("chars", array, true).toString());
assertEquals(baseStr + "[letters=<size=4>]",
@ -347,7 +347,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendDoubleArrayWithFieldNameAndFullDetatil() {
public void testAppendDoubleArrayWithFieldNameAndFullDetail() {
final double[] array = { 1.0, 2.9876, -3.00001, 4.3 };
assertEquals(baseStr + "[values={1.0,2.9876,-3.00001,4.3}]",
new ToStringBuilder(base).append("values", array, true).toString());
@ -371,7 +371,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendFloatArrayWithFieldNameAndFullDetatil() {
public void testAppendFloatArrayWithFieldNameAndFullDetail() {
final float[] array = { 1.0f, 2.9876f, -3.00001f, 4.3f };
assertEquals(baseStr + "[values={1.0,2.9876,-3.00001,4.3}]",
new ToStringBuilder(base).append("values", array, true).toString());
@ -394,7 +394,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendIntArrayWithFieldNameAndFullDetatil() {
public void testAppendIntArrayWithFieldNameAndFullDetail() {
final int[] array = { 1, 2, -3, 4 };
assertEquals(baseStr + "[values={1,2,-3,4}]",
new ToStringBuilder(base).append("values", array, true).toString());
@ -417,7 +417,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendLongArrayWithFieldNameAndFullDetatil() {
public void testAppendLongArrayWithFieldNameAndFullDetail() {
final long[] array = { 1, 2, -3, 4 };
assertEquals(baseStr + "[values={1,2,-3,4}]",
new ToStringBuilder(base).append("values", array, true).toString());
@ -441,7 +441,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendObjectArrayWithFieldNameAndFullDetatil() {
public void testAppendObjectArrayWithFieldNameAndFullDetail() {
final Object[] array = { null, base, new int[] { 3, 6 } };
assertEquals(baseStr + "[values={<null>,5,{3,6}}]",
new ToStringBuilder(base).append("values", array, true).toString());
@ -466,7 +466,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testAppendShortArrayWithFieldNameAndFullDetatil() {
public void testAppendShortArrayWithFieldNameAndFullDetail() {
final short[] array = { 1, 2, -3, 4 };
assertEquals(baseStr + "[values={1,2,-3,4}]",
new ToStringBuilder(base).append("values", array, true).toString());
@ -1048,7 +1048,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testReflectionhortArrayArray() {
public void testReflectionShort2DArray() {
short[][] array = { { 1, 2 }, null, { 5 } };
final String baseString = this.toBaseString(array);
assertEquals(baseString + "[{{1,2},<null>,{5}}]", ToStringBuilder.reflectionToString(array));
@ -1158,7 +1158,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
}
@Test
public void testReflectionyteArray() {
public void testReflectionByteArray() {
byte[] array = { 1, 2, -3, 4 };
final String baseString = this.toBaseString(array);
assertEquals(baseString + "[{1,2,-3,4}]", ToStringBuilder.reflectionToString(array));

View File

@ -100,7 +100,7 @@ public abstract class AbstractConcurrentInitializerCloseAndExceptionsTest extend
/**
* This method tests that if AbstractConcurrentInitializer.close catches a
* RuntimeException it will throw it withuot wrapping it in a ConcurrentException
* RuntimeException it will throw it without wrapping it in a ConcurrentException
*/
@SuppressWarnings("rawtypes")
@Test
@ -176,9 +176,9 @@ public abstract class AbstractConcurrentInitializerCloseAndExceptionsTest extend
CloseableObject::new,
CloseableObject::close);
CloseableObject cloesableObject = initializer.get();
assertFalse(cloesableObject.isClosed());
CloseableObject closeableObject = initializer.get();
assertFalse(closeableObject.isClosed());
((AbstractConcurrentInitializer) initializer).close();
assertTrue(cloesableObject.isClosed());
assertTrue(closeableObject.isClosed());
}
}

View File

@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
public class BackgroundInitializerSupplierTest extends BackgroundInitializerTest {
/**
* A concrete implementation of BackgroundInitializer. It is designed as a warpper so the test can
* A concrete implementation of BackgroundInitializer. It is designed as a wrapper so the test can
* use the same builder pattern that real code will.
*/
protected static final class SupplierBackgroundInitializerTestImpl extends AbstractBackgroundInitializerTestImpl {

View File

@ -301,10 +301,10 @@ public class BackgroundInitializerTest extends AbstractLangTest {
init.enableLatch();
init.start();
assertTrue(init.isStarted(), "Not started"); //Started and Initialized should return opposite values
assertFalse(init.isInitialized(), "Initalized before releasing latch");
assertFalse(init.isInitialized(), "Initialized before releasing latch");
init.releaseLatch();
init.get(); //to ensure the initialize thread has completed.
assertTrue(init.isInitialized(), "Not initalized after releasing latch");
assertTrue(init.isInitialized(), "Not initialized after releasing latch");
}
/**

View File

@ -99,7 +99,7 @@ public class MultiBackgroundInitializerSupplierTest extends MultiBackgroundIniti
final AbstractChildBackgroundInitializer childOne = createChildBackgroundInitializer();
final AbstractChildBackgroundInitializer childTwo = createChildBackgroundInitializer();
assertFalse(initializer.isInitialized(), "Initalized without having anything to initalize");
assertFalse(initializer.isInitialized(), "Initialized without having anything to initialize");
initializer.addInitializer("child one", childOne);
initializer.addInitializer("child two", childTwo);

View File

@ -431,7 +431,7 @@ public class MultiBackgroundInitializerTest extends AbstractLangTest {
childOne.enableLatch();
childTwo.enableLatch();
assertFalse(initializer.isInitialized(), "Initalized without having anything to initalize");
assertFalse(initializer.isInitialized(), "Initialized without having anything to initialize");
initializer.addInitializer("child one", childOne);
initializer.addInitializer("child two", childTwo);
@ -448,15 +448,15 @@ public class MultiBackgroundInitializerTest extends AbstractLangTest {
}
}
assertFalse(initializer.isInitialized(), "Initalized with two children running");
assertFalse(initializer.isInitialized(), "Initialized with two children running");
childOne.releaseLatch();
childOne.get(); //ensure this child finishes initializing
assertFalse(initializer.isInitialized(), "Initalized with one child running");
assertFalse(initializer.isInitialized(), "Initialized with one child running");
childTwo.releaseLatch();
childTwo.get(); //ensure this child finishes initializing
assertTrue(initializer.isInitialized(), "Not initalized with no children running");
assertTrue(initializer.isInitialized(), "Not initialized with no children running");
}
/**

View File

@ -379,7 +379,7 @@ public class MethodUtilsTest extends AbstractLangTest {
}
// These varOverloadEcho and varOverloadEchoStatic methods are designed to verify that
// not only is the correct overloaded variant invoked, but that the varags arguments
// not only is the correct overloaded variant invoked, but that the varargs arguments
// are also delivered correctly to the method.
public ImmutablePair<String, Object[]> varOverloadEcho(final String... args) {
return new ImmutablePair<>("String...", args);

View File

@ -935,7 +935,7 @@ public class TypeUtilsTest<B> extends AbstractLangTest {
@Test
@Disabled("TODO")
public void testIsAssignableGenericArrayTypeToWildercardType() {
public void testIsAssignableGenericArrayTypeToWildcardType() {
final Class<Constructor> rawClass = Constructor.class;
final Class<Insets> typeArgClass = Insets.class;
// Builds a ParameterizedType for Constructor<Insets>

View File

@ -287,7 +287,7 @@ public class FluentBitSetTest extends AbstractLangTest {
assertFalse(bs.get(i), "Shouldn't have flipped bit " + i);
}
// pos1 and pos2 is in the same bitset element, boundry testing
// pos1 and pos2 is in the same bitset element, boundary testing
bs = newInstance(16);
initialSize = bs.size();
bs.set(0, initialSize);
@ -634,7 +634,7 @@ public class FluentBitSetTest extends AbstractLangTest {
assertTrue(!bs.get(i), "Shouldn't have flipped bit " + i);
}
// pos1 and pos2 is in the same bitset element, boundry testing
// pos1 and pos2 is in the same bitset element, boundary testing
bs = newInstance(16);
bs.set(7);
bs.set(10);
@ -1360,7 +1360,7 @@ public class FluentBitSetTest extends AbstractLangTest {
}
}
// pos1 and pos2 is in the same bitset element, boundry testing
// pos1 and pos2 is in the same bitset element, boundary testing
bs = newInstance(16);
bs.set(7, 64);
assertEquals(64, bs.size(), "Failed to grow BitSet");
@ -1506,7 +1506,7 @@ public class FluentBitSetTest extends AbstractLangTest {
}
}
// pos1 and pos2 is in the same bitset element, boundry testing
// pos1 and pos2 is in the same bitset element, boundary testing
bs = newInstance(16);
bs.setInclusive(7, 64);
assertEquals(128, bs.size(), "Failed to grow BitSet");