Skip to content

Commit

Permalink
Normalize spelling to US English
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Oct 31, 2023
1 parent 6758866 commit b0d413b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private static void assertCopyMatchesPreJumpState(TestJumpFunction jumpFunction,
generator.nextBoolean();

final RandomProviderState preJumpState = ((RestorableUniformRandomProvider) generator).saveState();
Assumptions.assumeTrue(preJumpState instanceof RandomProviderDefaultState, "Not a recognised state");
Assumptions.assumeTrue(preJumpState instanceof RandomProviderDefaultState, "Not a recognized state");

final UniformRandomProvider copy = jumpFunction.jump();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,28 @@
* Utility methods for a {@link UniformRandomProvider}.
*/
final class RNGUtils {

/** Name prefix for bit-reversed RNGs. */
private static final String BYTE_REVERSED = "Byte-reversed ";

/** Name prefix for bit-reversed RNGs. */
private static final String BIT_REVERSED = "Bit-reversed ";

/** Name prefix for hash code mixed RNGs. */
private static final String HASH_CODE = "HashCode ^ ";

/** Name prefix for ThreadLocalRandom xor mixed RNGs. */
private static final String TLR_MIXED = "ThreadLocalRandom ^ ";

/** Name of xor operator for xor mixed RNGs. */
private static final String XOR = " ^ ";
/** Message for an unrecognised source64 mode. */
private static final String UNRECOGNISED_SOURCE_64_MODE = "Unrecognised source64 mode: ";
/** Message for an unrecognised native output type. */
private static final String UNRECOGNISED_NATIVE_TYPE = "Unrecognised native output type: ";

/** Message for an unrecognized source64 mode. */
private static final String UNRECOGNISED_SOURCE_64_MODE = "Unrecognized source64 mode: ";

/** Message for an unrecognized native output type. */
private static final String UNRECOGNISED_NATIVE_TYPE = "Unrecognized native output type: ";

/** The source64 mode for the default LongProvider caching implementation. */
private static final Source64Mode SOURCE_64_DEFAULT = Source64Mode.LO_HI;

Expand All @@ -67,7 +75,7 @@ static Source64Mode getSource64Default() {
*
* @param rng The random generator.
* @return the byte reversed random generator.
* @throws ApplicationException If the input source native type is not recognised.
* @throws ApplicationException If the input source native type is not recognized.
* @see Integer#reverseBytes(int)
* @see Long#reverseBytes(long)
*/
Expand Down Expand Up @@ -108,7 +116,7 @@ public String toString() {
*
* @param rng The random generator.
* @return the bit reversed random generator.
* @throws ApplicationException If the input source native type is not recognised.
* @throws ApplicationException If the input source native type is not recognized.
* @see Integer#reverse(int)
* @see Long#reverse(long)
*/
Expand Down Expand Up @@ -329,7 +337,7 @@ public String toString() {
*
* @param rng The random generator.
* @return the combined random generator.
* @throws ApplicationException If the input source native type is not recognised.
* @throws ApplicationException If the input source native type is not recognized.
* @see System#identityHashCode(Object)
*/
static UniformRandomProvider createHashCodeProvider(final UniformRandomProvider rng) {
Expand Down Expand Up @@ -377,7 +385,7 @@ public String toString() {
*
* @param rng The random generator.
* @return the combined random generator.
* @throws ApplicationException If the input source native type is not recognised.
* @throws ApplicationException If the input source native type is not recognized.
*/
static UniformRandomProvider createThreadLocalRandomProvider(final UniformRandomProvider rng) {
if (rng instanceof RandomIntSource) {
Expand Down Expand Up @@ -423,7 +431,7 @@ public String toString() {
* @param rng1 The first random generator.
* @param rng2 The second random generator.
* @return the combined random generator.
* @throws ApplicationException If the input source native type is not recognised.
* @throws ApplicationException If the input source native type is not recognized.
*/
static UniformRandomProvider createXorProvider(final UniformRandomProvider rng1,
final UniformRandomProvider rng2) {
Expand Down Expand Up @@ -497,7 +505,7 @@ public String toString() {
* @param byteSize Number of bytes values to write.
* @param byteOrder Byte order.
* @return the data output
* @throws ApplicationException If the input source native type is not recognised; or if
* @throws ApplicationException If the input source native type is not recognized; or if
* the mode for a RandomLongSource is not one of: raw; hi-lo; or lo-hi.
*/
static RngDataOutput createDataOutput(final UniformRandomProvider rng, Source64Mode source64,
Expand Down Expand Up @@ -533,7 +541,7 @@ static RngDataOutput createDataOutput(final UniformRandomProvider rng, Source64M
*
* @param argument the argument
* @return the object
* @throws ApplicationException If the argument is not recognised
* @throws ApplicationException If the argument is not recognized
*/
static Object parseArgument(String argument) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ private static boolean getBitReversed(File resultFile, Iterator<String> iter) {

/**
* Gets the test format from the output. This scans the stdout produced by a test application.
* If it is not recognised this may be a valid partial result or an unknown result. Throw
* If it is not recognized this may be a valid partial result or an unknown result. Throw
* an exception if not allowing partial results, otherwise log an error.
*
* @param resultFile Result file (for the exception message).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected long[] convert(byte[] seed, int size) {
}
};

/** Error message for unrecognised seed types. */
/** Error message for unrecognized seed types. */
private static final String UNRECOGNISED_SEED = "Unrecognized seed type: ";
/** Maximum length of the seed array (for creating array seeds). */
private static final int RANDOM_SEED_ARRAY_SIZE = 128;
Expand Down Expand Up @@ -261,7 +261,7 @@ public Object convertSeed(Object seed,
return convert((byte[]) seed, size);
}

throw new UnsupportedOperationException(unrecognisedSeedMessage(seed));
throw new UnsupportedOperationException(unrecognizedSeedMessage(seed));
}

/**
Expand Down Expand Up @@ -329,16 +329,16 @@ public static byte[] convertSeedToBytes(Object seed) {
return (byte[]) seed;
}

throw new UnsupportedOperationException(unrecognisedSeedMessage(seed));
throw new UnsupportedOperationException(unrecognizedSeedMessage(seed));
}

/**
* Create an unrecognised seed message. This will add the class type of the seed.
* Create an unrecognized seed message. This will add the class type of the seed.
*
* @param seed the seed
* @return the message
*/
private static String unrecognisedSeedMessage(Object seed) {
private static String unrecognizedSeedMessage(Object seed) {
return UNRECOGNISED_SEED + ((seed == null) ? "null" : seed.getClass().getName());
}
}

0 comments on commit b0d413b

Please sign in to comment.