Make package private class final

This commit is contained in:
Gary Gregory 2023-11-05 09:42:01 -05:00
parent 78211641f1
commit 563bf48964
18 changed files with 130 additions and 130 deletions

View File

@ -32,7 +32,7 @@ import java.nio.charset.UnsupportedCharsetException;
* *
* @since 3.10 * @since 3.10
*/ */
class Charsets { final class Charsets {
/** /**
* Returns the given {@code charset} or the default Charset if {@code charset} is null. * Returns the given {@code charset} or the default Charset if {@code charset} is null.

View File

@ -23,7 +23,7 @@ import java.util.Objects;
/** /**
* Package-private reflection code. * Package-private reflection code.
*/ */
class Reflection { final class Reflection {
/** /**
* Delegates to {@link Field#get(Object)} and rethrows {@link IllegalAccessException} as {@link IllegalArgumentException}. * Delegates to {@link Field#get(Object)} and rethrows {@link IllegalAccessException} as {@link IllegalArgumentException}.

View File

@ -31,7 +31,7 @@ import org.apache.commons.lang3.exception.UncheckedInterruptedException;
* @see Future * @see Future
* @since 3.13.0 * @since 3.13.0
*/ */
class UncheckedFutureImpl<V> extends AbstractFutureProxy<V> implements UncheckedFuture<V> { final class UncheckedFutureImpl<V> extends AbstractFutureProxy<V> implements UncheckedFuture<V> {
UncheckedFutureImpl(final Future<V> future) { UncheckedFutureImpl(final Future<V> future) {
super(future); super(future);

View File

@ -86,7 +86,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
/** /**
* Inner class to allow StrBuilder to operate as a reader. * Inner class to allow StrBuilder to operate as a reader.
*/ */
class StrBuilderReader extends Reader { final class StrBuilderReader extends Reader {
/** The current stream position. */ /** The current stream position. */
private int pos; private int pos;
/** The last mark position. */ /** The last mark position. */
@ -175,7 +175,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
/** /**
* Inner class to allow StrBuilder to operate as a tokenizer. * Inner class to allow StrBuilder to operate as a tokenizer.
*/ */
class StrBuilderTokenizer extends StrTokenizer { final class StrBuilderTokenizer extends StrTokenizer {
/** /**
* Default constructor. * Default constructor.
@ -206,7 +206,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
/** /**
* Inner class to allow StrBuilder to operate as a writer. * Inner class to allow StrBuilder to operate as a writer.
*/ */
class StrBuilderWriter extends Writer { final class StrBuilderWriter extends Writer {
/** /**
* Default constructor. * Default constructor.

View File

@ -25,7 +25,7 @@ import java.util.TimeZone;
* *
* @since 3.7 * @since 3.7
*/ */
class GmtTimeZone extends TimeZone { final class GmtTimeZone extends TimeZone {
private static final int MILLISECONDS_PER_MINUTE = 60 * 1000; private static final int MILLISECONDS_PER_MINUTE = 60 * 1000;
private static final int MINUTES_PER_HOUR = 60; private static final int MINUTES_PER_HOUR = 60;

View File

@ -102,7 +102,7 @@ public class AnnotationUtilsTest extends AbstractLangTest {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD}) @Target({ElementType.METHOD})
public @interface TestMethodAnnotation { public @interface TestMethodAnnotation {
class None extends Throwable { final class None extends Throwable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -222,7 +222,7 @@ public class ArrayUtilsTest extends AbstractLangTest {
} }
} }
class LANG1261ChildObject extends LANG1261ParentObject { final class LANG1261ChildObject extends LANG1261ParentObject {
// empty. // empty.
} }

View File

@ -272,7 +272,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("java.lang.String[][][][]", ClassUtils.getCanonicalName(String[][][][].class)); assertEquals("java.lang.String[][][][]", ClassUtils.getCanonicalName(String[][][][].class));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals(StringUtils.EMPTY, ClassUtils.getCanonicalName(new Object() { assertEquals(StringUtils.EMPTY, ClassUtils.getCanonicalName(new Object() {
@ -317,7 +317,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("java.lang.String[][][][]", ClassUtils.getCanonicalName(String[][][][].class, "X")); assertEquals("java.lang.String[][][][]", ClassUtils.getCanonicalName(String[][][][].class, "X"));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals("X", ClassUtils.getCanonicalName(new Object() { assertEquals("X", ClassUtils.getCanonicalName(new Object() {
@ -369,7 +369,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("[[[[Ljava.lang.String;", ClassUtils.getName(String[][][][].class)); assertEquals("[[[[Ljava.lang.String;", ClassUtils.getName(String[][][][].class));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals("org.apache.commons.lang3.ClassUtilsTest$3", ClassUtils.getName(new Object() { assertEquals("org.apache.commons.lang3.ClassUtilsTest$3", ClassUtils.getName(new Object() {
@ -388,7 +388,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("<null>", ClassUtils.getName(null, "<null>")); assertEquals("<null>", ClassUtils.getName(null, "<null>"));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals("org.apache.commons.lang3.ClassUtilsTest$4", ClassUtils.getName(new Object() { assertEquals("org.apache.commons.lang3.ClassUtilsTest$4", ClassUtils.getName(new Object() {
@ -407,7 +407,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("", ClassUtils.getPackageCanonicalName(int[][].class)); assertEquals("", ClassUtils.getPackageCanonicalName(int[][].class));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals("org.apache.commons.lang3", ClassUtils.getPackageCanonicalName(new Object() { assertEquals("org.apache.commons.lang3", ClassUtils.getPackageCanonicalName(new Object() {
@ -428,7 +428,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("", ClassUtils.getPackageCanonicalName(new int[0][0], "<null>")); assertEquals("", ClassUtils.getPackageCanonicalName(new int[0][0], "<null>"));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals("org.apache.commons.lang3", ClassUtils.getPackageCanonicalName(new Object() { assertEquals("org.apache.commons.lang3", ClassUtils.getPackageCanonicalName(new Object() {
@ -481,7 +481,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("java.lang", ClassUtils.getPackageName(String[][][][].class)); assertEquals("java.lang", ClassUtils.getPackageName(String[][][][].class));
// On-the-fly types // On-the-fly types
class Named { final class Named {
// empty // empty
} }
assertEquals("org.apache.commons.lang3", ClassUtils.getPackageName(new Object() { assertEquals("org.apache.commons.lang3", ClassUtils.getPackageName(new Object() {
@ -514,7 +514,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("int[][]", ClassUtils.getShortCanonicalName(int[][].class)); assertEquals("int[][]", ClassUtils.getShortCanonicalName(int[][].class));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals("", ClassUtils.getShortCanonicalName(new Object() { assertEquals("", ClassUtils.getShortCanonicalName(new Object() {
@ -536,7 +536,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("int[][]", ClassUtils.getShortCanonicalName(new int[0][0], "<null>")); assertEquals("int[][]", ClassUtils.getShortCanonicalName(new int[0][0], "<null>"));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
assertEquals("", ClassUtils.getShortCanonicalName(new Object() { assertEquals("", ClassUtils.getShortCanonicalName(new Object() {
@ -619,7 +619,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("String[][][][]", ClassUtils.getShortClassName(String[][][][].class)); assertEquals("String[][][][]", ClassUtils.getShortClassName(String[][][][].class));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
// WARNING: this is fragile, implementation may change, naming is not guaranteed // WARNING: this is fragile, implementation may change, naming is not guaranteed
@ -639,7 +639,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("<null>", ClassUtils.getShortClassName(null, "<null>")); assertEquals("<null>", ClassUtils.getShortClassName(null, "<null>"));
// Inner types // Inner types
class Named { final class Named {
// empty // empty
} }
// WARNING: this is fragile, implementation may change, naming is not guaranteed // WARNING: this is fragile, implementation may change, naming is not guaranteed
@ -695,7 +695,7 @@ public class ClassUtilsTest extends AbstractLangTest {
assertEquals("String[][][][]", ClassUtils.getSimpleName(String[][][][].class)); assertEquals("String[][][][]", ClassUtils.getSimpleName(String[][][][].class));
// On-the-fly types // On-the-fly types
class Named { final class Named {
// empty // empty
} }
assertEquals("", ClassUtils.getSimpleName(new Object() { assertEquals("", ClassUtils.getSimpleName(new Object() {

View File

@ -41,7 +41,7 @@ import java.util.HashMap;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
class ClassNotFoundSerialization implements Serializable { final class ClassNotFoundSerialization implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -42,13 +42,13 @@ import org.junit.jupiter.api.Test;
public class ValidateTest extends AbstractLangTest { public class ValidateTest extends AbstractLangTest {
@Nested @Nested
class ExclusiveBetween { final class ExclusiveBetween {
@Nested @Nested
class WithComparable { final class WithComparable {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -84,7 +84,7 @@ public class ValidateTest extends AbstractLangTest {
} }
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -126,10 +126,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithDouble { final class WithDouble {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -165,7 +165,7 @@ public class ValidateTest extends AbstractLangTest {
} }
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -207,10 +207,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithLong { final class WithLong {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -246,7 +246,7 @@ public class ValidateTest extends AbstractLangTest {
} }
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -289,10 +289,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class Finite { final class Finite {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForFiniteValue() { void shouldNotThrowExceptionForFiniteValue() {
@ -319,7 +319,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForFiniteValue() { void shouldNotThrowExceptionForFiniteValue() {
@ -347,13 +347,13 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class InclusiveBetween { final class InclusiveBetween {
@Nested @Nested
class WithComparable { final class WithComparable {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -385,7 +385,7 @@ public class ValidateTest extends AbstractLangTest {
} }
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -423,10 +423,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithDouble { final class WithDouble {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -458,7 +458,7 @@ public class ValidateTest extends AbstractLangTest {
} }
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -496,10 +496,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithLong { final class WithLong {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -531,7 +531,7 @@ public class ValidateTest extends AbstractLangTest {
} }
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsBetweenBounds() { void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
@ -570,10 +570,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class IsAssignable { final class IsAssignable {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenClassIsAssignable() { void shouldNotThrowExceptionWhenClassIsAssignable() {
@ -589,7 +589,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenClassIsAssignable() { void shouldNotThrowExceptionWhenClassIsAssignable() {
@ -623,10 +623,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class IsInstanceOf { final class IsInstanceOf {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsInstanceOfClass() { void shouldNotThrowExceptionWhenValueIsInstanceOfClass() {
@ -641,7 +641,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithMessageTemplate { final class WithMessageTemplate {
@Test @Test
void shouldNotThrowExceptionWhenValueIsInstanceOfClass() { void shouldNotThrowExceptionWhenValueIsInstanceOfClass() {
@ -657,7 +657,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenValueIsInstanceOfClass() { void shouldNotThrowExceptionWhenValueIsInstanceOfClass() {
@ -673,10 +673,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class IsTrue { final class IsTrue {
@Nested @Nested
class WithDoubleTemplate { final class WithDoubleTemplate {
@Test @Test
void shouldNotThrowForTrueExpression() { void shouldNotThrowForTrueExpression() {
@ -691,7 +691,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithLongTemplate { final class WithLongTemplate {
@Test @Test
void shouldNotThrowForTrueExpression() { void shouldNotThrowForTrueExpression() {
@ -706,7 +706,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowForTrueExpression() { void shouldNotThrowForTrueExpression() {
@ -727,7 +727,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithObjectTemplate { final class WithObjectTemplate {
@Test @Test
void shouldNotThrowForTrueExpression() { void shouldNotThrowForTrueExpression() {
@ -743,7 +743,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowForTrueExpression() { void shouldNotThrowForTrueExpression() {
@ -760,10 +760,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class MatchesPattern { final class MatchesPattern {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionWhenStringMatchesPattern() { void shouldNotThrowExceptionWhenStringMatchesPattern() {
@ -778,7 +778,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionWhenStringMatchesPattern() { void shouldNotThrowExceptionWhenStringMatchesPattern() {
@ -794,13 +794,13 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class NoNullElements { final class NoNullElements {
@Nested @Nested
class WithArray { final class WithArray {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyArray() { void shouldNotThrowExceptionForNonEmptyArray() {
@ -828,7 +828,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyArray() { void shouldNotThrowExceptionForNonEmptyArray() {
@ -856,10 +856,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithCollection { final class WithCollection {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyCollection() { void shouldNotThrowExceptionForNonEmptyCollection() {
@ -887,7 +887,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyCollection() { void shouldNotThrowExceptionForNonEmptyCollection() {
@ -917,10 +917,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class NotBlank { final class NotBlank {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyString() { void shouldNotThrowExceptionForNonEmptyString() {
@ -968,7 +968,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyString() { void shouldNotThrowExceptionForNonEmptyString() {
@ -1017,13 +1017,13 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class NotEmpty { final class NotEmpty {
@Nested @Nested
class WithArray { final class WithArray {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForArrayContainingNullReference() { void shouldNotThrowExceptionForArrayContainingNullReference() {
@ -1050,7 +1050,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForArrayContainingNullReference() { void shouldNotThrowExceptionForArrayContainingNullReference() {
@ -1078,10 +1078,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithCharSequence { final class WithCharSequence {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyString() { void shouldNotThrowExceptionForNonEmptyString() {
@ -1107,7 +1107,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForNonEmptyString() { void shouldNotThrowExceptionForNonEmptyString() {
@ -1134,10 +1134,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithCollection { final class WithCollection {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForCollectionContainingNullReference() { void shouldNotThrowExceptionForCollectionContainingNullReference() {
@ -1164,7 +1164,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForCollectionContainingNullReference() { void shouldNotThrowExceptionForCollectionContainingNullReference() {
@ -1192,10 +1192,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithMap { final class WithMap {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForMapContainingNullMapping() { void shouldNotThrowExceptionForMapContainingNullMapping() {
@ -1222,7 +1222,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForMapContainingNullMapping() { void shouldNotThrowExceptionForMapContainingNullMapping() {
@ -1251,10 +1251,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class NotNaN { final class NotNaN {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForNegativeInfinity() { void shouldNotThrowExceptionForNegativeInfinity() {
@ -1279,7 +1279,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForNegativeInfinity() { void shouldNotThrowExceptionForNegativeInfinity() {
@ -1305,10 +1305,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class NotNull { final class NotNull {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowForNonNullReference() { void shouldNotThrowForNonNullReference() {
@ -1328,7 +1328,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowForNonNullReference() { void shouldNotThrowForNonNullReference() {
@ -1349,7 +1349,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class UtilClassConventions { final class UtilClassConventions {
@Test @Test
void hasOnlyOnePublicConstructor() { void hasOnlyOnePublicConstructor() {
@ -1374,13 +1374,13 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class ValidIndex { final class ValidIndex {
@Nested @Nested
class WithArray { final class WithArray {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForValidIndex() { void shouldNotThrowExceptionForValidIndex() {
@ -1414,7 +1414,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForValidIndex() { void shouldNotThrowExceptionForValidIndex() {
@ -1448,10 +1448,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithCharSequence { final class WithCharSequence {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForValidIndex() { void shouldNotThrowExceptionForValidIndex() {
@ -1484,7 +1484,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForValidIndex() { void shouldNotThrowExceptionForValidIndex() {
@ -1518,10 +1518,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithCollection { final class WithCollection {
@Nested @Nested
class WithMessage { final class WithMessage {
@Test @Test
void shouldNotThrowExceptionForValidIndex() { void shouldNotThrowExceptionForValidIndex() {
@ -1555,7 +1555,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForValidIndex() { void shouldNotThrowExceptionForValidIndex() {
@ -1592,10 +1592,10 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class ValidState { final class ValidState {
@Nested @Nested
class WithoutMessage { final class WithoutMessage {
@Test @Test
void shouldNotThrowExceptionForTrueExpression() { void shouldNotThrowExceptionForTrueExpression() {
@ -1610,7 +1610,7 @@ public class ValidateTest extends AbstractLangTest {
} }
@Nested @Nested
class WitMessage { final class WitMessage {
@Test @Test
void shouldNotThrowExceptionForValidIndex() { void shouldNotThrowExceptionForValidIndex() {
Validate.validState(true, "The Message"); Validate.validState(true, "The Message");

View File

@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
*/ */
public class ReflectionToStringBuilderExcludeTest extends AbstractLangTest { public class ReflectionToStringBuilderExcludeTest extends AbstractLangTest {
class TestFixture { final class TestFixture {
@SuppressWarnings("unused") @SuppressWarnings("unused")
private final String secretField = SECRET_VALUE; private final String secretField = SECRET_VALUE;

View File

@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
*/ */
public class ReflectionToStringBuilderExcludeWithAnnotationTest extends AbstractLangTest { public class ReflectionToStringBuilderExcludeWithAnnotationTest extends AbstractLangTest {
class TestFixture { final class TestFixture {
@ToStringExclude @ToStringExclude
private final String excludedField = EXCLUDED_FIELD_VALUE; private final String excludedField = EXCLUDED_FIELD_VALUE;

View File

@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
public class ReflectionToStringBuilderIncludeTest extends AbstractLangTest { public class ReflectionToStringBuilderIncludeTest extends AbstractLangTest {
class TestFeature { final class TestFeature {
@SuppressWarnings("unused") @SuppressWarnings("unused")
private final String field1 = VALUES[0]; private final String field1 = VALUES[0];

View File

@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
*/ */
public class ReflectionToStringBuilderMutateInspectConcurrencyTest extends AbstractLangTest { public class ReflectionToStringBuilderMutateInspectConcurrencyTest extends AbstractLangTest {
class InspectingClient implements Runnable { final class InspectingClient implements Runnable {
private final TestFixture testFixture; private final TestFixture testFixture;
InspectingClient(final TestFixture testFixture) { InspectingClient(final TestFixture testFixture) {
@ -50,7 +50,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest extends Abstr
} }
} }
class MutatingClient implements Runnable { final class MutatingClient implements Runnable {
private final TestFixture testFixture; private final TestFixture testFixture;
private final Random random = new Random(); private final Random random = new Random();
@ -68,7 +68,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest extends Abstr
} }
} }
class TestFixture { final class TestFixture {
private final LinkedList<Integer> listField = new LinkedList<>(); private final LinkedList<Integer> listField = new LinkedList<>();
private final Random random = new Random(); private final Random random = new Random();
private final int N = 100; private final int N = 100;

View File

@ -37,7 +37,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
* Test fixture for ReflectionToStringBuilder.toString() for statics. * Test fixture for ReflectionToStringBuilder.toString() for statics.
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
class InheritedReflectionStaticFieldsFixture extends SimpleReflectionStaticFieldsFixture { final class InheritedReflectionStaticFieldsFixture extends SimpleReflectionStaticFieldsFixture {
static final String staticString2 = "staticString2"; static final String staticString2 = "staticString2";
static final int staticInt2 = 67890; static final int staticInt2 = 67890;
} }
@ -45,7 +45,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
* Points out failure to print anything from appendToString methods using MULTI_LINE_STYLE. * Points out failure to print anything from appendToString methods using MULTI_LINE_STYLE.
* See issue LANG-372. * See issue LANG-372.
*/ */
class MultiLineTestObject { final class MultiLineTestObject {
Integer i = Integer.valueOf(31337); Integer i = Integer.valueOf(31337);
@Override @Override
public String toString() { public String toString() {
@ -62,7 +62,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
} }
static class Outer { static class Outer {
class Inner { final class Inner {
@Override @Override
public String toString() { public String toString() {
return ToStringBuilder.reflectionToString(this); return ToStringBuilder.reflectionToString(this);
@ -78,7 +78,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
/** /**
* Tests ReflectionToStringBuilder.toString() for statics. * Tests ReflectionToStringBuilder.toString() for statics.
*/ */
class ReflectionStaticFieldsFixture { final class ReflectionStaticFieldsFixture {
static final String staticString = "staticString"; static final String staticString = "staticString";
static final int staticInt = 12345; static final int staticInt = 12345;
static final transient String staticTransientString = "staticTransientString"; static final transient String staticTransientString = "staticTransientString";

View File

@ -35,15 +35,15 @@ import org.junit.jupiter.api.Test;
public class ComparableUtilsTest extends AbstractLangTest { public class ComparableUtilsTest extends AbstractLangTest {
@Nested @Nested
class A_is_1 { final class A_is_1 {
@DisplayName("B is 0 (B < A)") @DisplayName("B is 0 (B < A)")
@Nested @Nested
class B_is_0 { final class B_is_0 {
@DisplayName("C is 0 ([B=C] < A)") @DisplayName("C is 0 ([B=C] < A)")
@Nested @Nested
class C_is_0 { final class C_is_0 {
BigDecimal c = BigDecimal.ZERO; BigDecimal c = BigDecimal.ZERO;
@ -71,7 +71,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("C is 1 (B < A = C)") @DisplayName("C is 1 (B < A = C)")
@Nested @Nested
class C_is_1 { final class C_is_1 {
BigDecimal c = BigDecimal.ONE; BigDecimal c = BigDecimal.ONE;
@ -98,7 +98,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("C is 10 (B < A < C)") @DisplayName("C is 10 (B < A < C)")
@Nested @Nested
class C_is_10 { final class C_is_10 {
BigDecimal c = BigDecimal.TEN; BigDecimal c = BigDecimal.TEN;
@ -173,11 +173,11 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("B is 1 (B = A)") @DisplayName("B is 1 (B = A)")
@Nested @Nested
class B_is_1 { final class B_is_1 {
@DisplayName("C is 0 (B = A > C)") @DisplayName("C is 0 (B = A > C)")
@Nested @Nested
class C_is_0 { final class C_is_0 {
BigDecimal c = BigDecimal.ZERO; BigDecimal c = BigDecimal.ZERO;
@ -204,7 +204,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("C is 1 (B = A = C)") @DisplayName("C is 1 (B = A = C)")
@Nested @Nested
class C_is_1 { final class C_is_1 {
BigDecimal c = BigDecimal.ONE; BigDecimal c = BigDecimal.ONE;
@ -231,7 +231,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("C is 10 (B = A < C)") @DisplayName("C is 10 (B = A < C)")
@Nested @Nested
class C_is_10 { final class C_is_10 {
BigDecimal c = BigDecimal.TEN; BigDecimal c = BigDecimal.TEN;
@ -306,11 +306,11 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("B is 10 (B > A)") @DisplayName("B is 10 (B > A)")
@Nested @Nested
class B_is_10 { final class B_is_10 {
@DisplayName("C is 0 (B > A > C)") @DisplayName("C is 0 (B > A > C)")
@Nested @Nested
class C_is_0 { final class C_is_0 {
BigDecimal c = BigDecimal.ZERO; BigDecimal c = BigDecimal.ZERO;
@ -337,7 +337,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("C is 1 (B > A = C)") @DisplayName("C is 1 (B > A = C)")
@Nested @Nested
class C_is_1 { final class C_is_1 {
BigDecimal c = BigDecimal.ONE; BigDecimal c = BigDecimal.ONE;
@ -364,7 +364,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
@DisplayName("C is 10 ([B,C] > A)") @DisplayName("C is 10 ([B,C] > A)")
@Nested @Nested
class C_is_10 { final class C_is_10 {
BigDecimal c = BigDecimal.TEN; BigDecimal c = BigDecimal.TEN;

View File

@ -69,7 +69,7 @@ public abstract class AbstractConcurrentInitializerTest extends AbstractLangTest
final ConcurrentInitializer<Object> initializer = createInitializer(); final ConcurrentInitializer<Object> initializer = createInitializer();
final int threadCount = 20; final int threadCount = 20;
final CountDownLatch startLatch = new CountDownLatch(1); final CountDownLatch startLatch = new CountDownLatch(1);
class GetThread extends Thread { final class GetThread extends Thread {
Object object; Object object;
@Override @Override

View File

@ -56,7 +56,7 @@ import org.apache.commons.lang3.reflect.testbed.StringParameterizedChild;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
class AAAClass extends AAClass<String> { final class AAAClass extends AAClass<String> {
public class BBBClass extends BBClass<String> { public class BBBClass extends BBClass<String> {
// empty // empty
} }
@ -72,7 +72,7 @@ class AAClass<T> {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
//raw types, where used, are used purposely //raw types, where used, are used purposely
class AClass extends AAClass<String>.BBClass<Number> { final class AClass extends AAClass<String>.BBClass<Number> {
@SuppressWarnings("unused") // Unused type parameter for test @SuppressWarnings("unused") // Unused type parameter for test
public interface AInterface<T> { public interface AInterface<T> {