Make package private class final
This commit is contained in:
parent
78211641f1
commit
563bf48964
|
@ -32,7 +32,7 @@ import java.nio.charset.UnsupportedCharsetException;
|
|||
*
|
||||
* @since 3.10
|
||||
*/
|
||||
class Charsets {
|
||||
final class Charsets {
|
||||
|
||||
/**
|
||||
* Returns the given {@code charset} or the default Charset if {@code charset} is null.
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Objects;
|
|||
/**
|
||||
* Package-private reflection code.
|
||||
*/
|
||||
class Reflection {
|
||||
final class Reflection {
|
||||
|
||||
/**
|
||||
* Delegates to {@link Field#get(Object)} and rethrows {@link IllegalAccessException} as {@link IllegalArgumentException}.
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.apache.commons.lang3.exception.UncheckedInterruptedException;
|
|||
* @see Future
|
||||
* @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) {
|
||||
super(future);
|
||||
|
|
|
@ -86,7 +86,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
|
|||
/**
|
||||
* Inner class to allow StrBuilder to operate as a reader.
|
||||
*/
|
||||
class StrBuilderReader extends Reader {
|
||||
final class StrBuilderReader extends Reader {
|
||||
/** The current stream position. */
|
||||
private int pos;
|
||||
/** 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.
|
||||
*/
|
||||
class StrBuilderTokenizer extends StrTokenizer {
|
||||
final class StrBuilderTokenizer extends StrTokenizer {
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
|
@ -206,7 +206,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
|
|||
/**
|
||||
* Inner class to allow StrBuilder to operate as a writer.
|
||||
*/
|
||||
class StrBuilderWriter extends Writer {
|
||||
final class StrBuilderWriter extends Writer {
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.TimeZone;
|
|||
*
|
||||
* @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 MINUTES_PER_HOUR = 60;
|
||||
|
|
|
@ -102,7 +102,7 @@ public class AnnotationUtilsTest extends AbstractLangTest {
|
|||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.METHOD})
|
||||
public @interface TestMethodAnnotation {
|
||||
class None extends Throwable {
|
||||
final class None extends Throwable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ public class ArrayUtilsTest extends AbstractLangTest {
|
|||
}
|
||||
}
|
||||
|
||||
class LANG1261ChildObject extends LANG1261ParentObject {
|
||||
final class LANG1261ChildObject extends LANG1261ParentObject {
|
||||
// empty.
|
||||
}
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ public class ClassUtilsTest extends AbstractLangTest {
|
|||
assertEquals("java.lang.String[][][][]", ClassUtils.getCanonicalName(String[][][][].class));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
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"));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
assertEquals("X", ClassUtils.getCanonicalName(new Object() {
|
||||
|
@ -369,7 +369,7 @@ public class ClassUtilsTest extends AbstractLangTest {
|
|||
assertEquals("[[[[Ljava.lang.String;", ClassUtils.getName(String[][][][].class));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
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>"));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
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));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
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>"));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
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));
|
||||
|
||||
// On-the-fly types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
assertEquals("org.apache.commons.lang3", ClassUtils.getPackageName(new Object() {
|
||||
|
@ -514,7 +514,7 @@ public class ClassUtilsTest extends AbstractLangTest {
|
|||
assertEquals("int[][]", ClassUtils.getShortCanonicalName(int[][].class));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
assertEquals("", ClassUtils.getShortCanonicalName(new Object() {
|
||||
|
@ -536,7 +536,7 @@ public class ClassUtilsTest extends AbstractLangTest {
|
|||
assertEquals("int[][]", ClassUtils.getShortCanonicalName(new int[0][0], "<null>"));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
assertEquals("", ClassUtils.getShortCanonicalName(new Object() {
|
||||
|
@ -619,7 +619,7 @@ public class ClassUtilsTest extends AbstractLangTest {
|
|||
assertEquals("String[][][][]", ClassUtils.getShortClassName(String[][][][].class));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
// 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>"));
|
||||
|
||||
// Inner types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
// 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));
|
||||
|
||||
// On-the-fly types
|
||||
class Named {
|
||||
final class Named {
|
||||
// empty
|
||||
}
|
||||
assertEquals("", ClassUtils.getSimpleName(new Object() {
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.HashMap;
|
|||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class ClassNotFoundSerialization implements Serializable {
|
||||
final class ClassNotFoundSerialization implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
|
@ -42,13 +42,13 @@ import org.junit.jupiter.api.Test;
|
|||
public class ValidateTest extends AbstractLangTest {
|
||||
|
||||
@Nested
|
||||
class ExclusiveBetween {
|
||||
final class ExclusiveBetween {
|
||||
|
||||
@Nested
|
||||
class WithComparable {
|
||||
final class WithComparable {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -84,7 +84,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
}
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -126,10 +126,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithDouble {
|
||||
final class WithDouble {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -165,7 +165,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
}
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -207,10 +207,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithLong {
|
||||
final class WithLong {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -246,7 +246,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
}
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -289,10 +289,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class Finite {
|
||||
final class Finite {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForFiniteValue() {
|
||||
|
@ -319,7 +319,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForFiniteValue() {
|
||||
|
@ -347,13 +347,13 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class InclusiveBetween {
|
||||
final class InclusiveBetween {
|
||||
|
||||
@Nested
|
||||
class WithComparable {
|
||||
final class WithComparable {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -385,7 +385,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
}
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -423,10 +423,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithDouble {
|
||||
final class WithDouble {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -458,7 +458,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
}
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -496,10 +496,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithLong {
|
||||
final class WithLong {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -531,7 +531,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
}
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsBetweenBounds() {
|
||||
|
@ -570,10 +570,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class IsAssignable {
|
||||
final class IsAssignable {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenClassIsAssignable() {
|
||||
|
@ -589,7 +589,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenClassIsAssignable() {
|
||||
|
@ -623,10 +623,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class IsInstanceOf {
|
||||
final class IsInstanceOf {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsInstanceOfClass() {
|
||||
|
@ -641,7 +641,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithMessageTemplate {
|
||||
final class WithMessageTemplate {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsInstanceOfClass() {
|
||||
|
@ -657,7 +657,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenValueIsInstanceOfClass() {
|
||||
|
@ -673,10 +673,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class IsTrue {
|
||||
final class IsTrue {
|
||||
|
||||
@Nested
|
||||
class WithDoubleTemplate {
|
||||
final class WithDoubleTemplate {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowForTrueExpression() {
|
||||
|
@ -691,7 +691,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithLongTemplate {
|
||||
final class WithLongTemplate {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowForTrueExpression() {
|
||||
|
@ -706,7 +706,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowForTrueExpression() {
|
||||
|
@ -727,7 +727,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithObjectTemplate {
|
||||
final class WithObjectTemplate {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowForTrueExpression() {
|
||||
|
@ -743,7 +743,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowForTrueExpression() {
|
||||
|
@ -760,10 +760,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class MatchesPattern {
|
||||
final class MatchesPattern {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenStringMatchesPattern() {
|
||||
|
@ -778,7 +778,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionWhenStringMatchesPattern() {
|
||||
|
@ -794,13 +794,13 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class NoNullElements {
|
||||
final class NoNullElements {
|
||||
|
||||
@Nested
|
||||
class WithArray {
|
||||
final class WithArray {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyArray() {
|
||||
|
@ -828,7 +828,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyArray() {
|
||||
|
@ -856,10 +856,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithCollection {
|
||||
final class WithCollection {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyCollection() {
|
||||
|
@ -887,7 +887,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyCollection() {
|
||||
|
@ -917,10 +917,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class NotBlank {
|
||||
final class NotBlank {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyString() {
|
||||
|
@ -968,7 +968,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyString() {
|
||||
|
@ -1017,13 +1017,13 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class NotEmpty {
|
||||
final class NotEmpty {
|
||||
|
||||
@Nested
|
||||
class WithArray {
|
||||
final class WithArray {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForArrayContainingNullReference() {
|
||||
|
@ -1050,7 +1050,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForArrayContainingNullReference() {
|
||||
|
@ -1078,10 +1078,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithCharSequence {
|
||||
final class WithCharSequence {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyString() {
|
||||
|
@ -1107,7 +1107,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNonEmptyString() {
|
||||
|
@ -1134,10 +1134,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithCollection {
|
||||
final class WithCollection {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForCollectionContainingNullReference() {
|
||||
|
@ -1164,7 +1164,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForCollectionContainingNullReference() {
|
||||
|
@ -1192,10 +1192,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithMap {
|
||||
final class WithMap {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForMapContainingNullMapping() {
|
||||
|
@ -1222,7 +1222,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForMapContainingNullMapping() {
|
||||
|
@ -1251,10 +1251,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class NotNaN {
|
||||
final class NotNaN {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNegativeInfinity() {
|
||||
|
@ -1279,7 +1279,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForNegativeInfinity() {
|
||||
|
@ -1305,10 +1305,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class NotNull {
|
||||
final class NotNull {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowForNonNullReference() {
|
||||
|
@ -1328,7 +1328,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowForNonNullReference() {
|
||||
|
@ -1349,7 +1349,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class UtilClassConventions {
|
||||
final class UtilClassConventions {
|
||||
|
||||
@Test
|
||||
void hasOnlyOnePublicConstructor() {
|
||||
|
@ -1374,13 +1374,13 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class ValidIndex {
|
||||
final class ValidIndex {
|
||||
|
||||
@Nested
|
||||
class WithArray {
|
||||
final class WithArray {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForValidIndex() {
|
||||
|
@ -1414,7 +1414,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForValidIndex() {
|
||||
|
@ -1448,10 +1448,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithCharSequence {
|
||||
final class WithCharSequence {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForValidIndex() {
|
||||
|
@ -1484,7 +1484,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForValidIndex() {
|
||||
|
@ -1518,10 +1518,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithCollection {
|
||||
final class WithCollection {
|
||||
|
||||
@Nested
|
||||
class WithMessage {
|
||||
final class WithMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForValidIndex() {
|
||||
|
@ -1555,7 +1555,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForValidIndex() {
|
||||
|
@ -1592,10 +1592,10 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class ValidState {
|
||||
final class ValidState {
|
||||
|
||||
@Nested
|
||||
class WithoutMessage {
|
||||
final class WithoutMessage {
|
||||
|
||||
@Test
|
||||
void shouldNotThrowExceptionForTrueExpression() {
|
||||
|
@ -1610,7 +1610,7 @@ public class ValidateTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
@Nested
|
||||
class WitMessage {
|
||||
final class WitMessage {
|
||||
@Test
|
||||
void shouldNotThrowExceptionForValidIndex() {
|
||||
Validate.validState(true, "The Message");
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
|
|||
*/
|
||||
public class ReflectionToStringBuilderExcludeTest extends AbstractLangTest {
|
||||
|
||||
class TestFixture {
|
||||
final class TestFixture {
|
||||
@SuppressWarnings("unused")
|
||||
private final String secretField = SECRET_VALUE;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
|
|||
*/
|
||||
public class ReflectionToStringBuilderExcludeWithAnnotationTest extends AbstractLangTest {
|
||||
|
||||
class TestFixture {
|
||||
final class TestFixture {
|
||||
@ToStringExclude
|
||||
private final String excludedField = EXCLUDED_FIELD_VALUE;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
public class ReflectionToStringBuilderIncludeTest extends AbstractLangTest {
|
||||
|
||||
class TestFeature {
|
||||
final class TestFeature {
|
||||
@SuppressWarnings("unused")
|
||||
private final String field1 = VALUES[0];
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
|
|||
*/
|
||||
public class ReflectionToStringBuilderMutateInspectConcurrencyTest extends AbstractLangTest {
|
||||
|
||||
class InspectingClient implements Runnable {
|
||||
final class InspectingClient implements Runnable {
|
||||
private 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 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 Random random = new Random();
|
||||
private final int N = 100;
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
|
|||
* Test fixture for ReflectionToStringBuilder.toString() for statics.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
class InheritedReflectionStaticFieldsFixture extends SimpleReflectionStaticFieldsFixture {
|
||||
final class InheritedReflectionStaticFieldsFixture extends SimpleReflectionStaticFieldsFixture {
|
||||
static final String staticString2 = "staticString2";
|
||||
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.
|
||||
* See issue LANG-372.
|
||||
*/
|
||||
class MultiLineTestObject {
|
||||
final class MultiLineTestObject {
|
||||
Integer i = Integer.valueOf(31337);
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -62,7 +62,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
|
|||
}
|
||||
|
||||
static class Outer {
|
||||
class Inner {
|
||||
final class Inner {
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
|
@ -78,7 +78,7 @@ public class ToStringBuilderTest extends AbstractLangTest {
|
|||
/**
|
||||
* Tests ReflectionToStringBuilder.toString() for statics.
|
||||
*/
|
||||
class ReflectionStaticFieldsFixture {
|
||||
final class ReflectionStaticFieldsFixture {
|
||||
static final String staticString = "staticString";
|
||||
static final int staticInt = 12345;
|
||||
static final transient String staticTransientString = "staticTransientString";
|
||||
|
|
|
@ -35,15 +35,15 @@ import org.junit.jupiter.api.Test;
|
|||
public class ComparableUtilsTest extends AbstractLangTest {
|
||||
|
||||
@Nested
|
||||
class A_is_1 {
|
||||
final class A_is_1 {
|
||||
|
||||
@DisplayName("B is 0 (B < A)")
|
||||
@Nested
|
||||
class B_is_0 {
|
||||
final class B_is_0 {
|
||||
|
||||
@DisplayName("C is 0 ([B=C] < A)")
|
||||
@Nested
|
||||
class C_is_0 {
|
||||
final class C_is_0 {
|
||||
|
||||
BigDecimal c = BigDecimal.ZERO;
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("C is 1 (B < A = C)")
|
||||
@Nested
|
||||
class C_is_1 {
|
||||
final class C_is_1 {
|
||||
|
||||
BigDecimal c = BigDecimal.ONE;
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("C is 10 (B < A < C)")
|
||||
@Nested
|
||||
class C_is_10 {
|
||||
final class C_is_10 {
|
||||
|
||||
BigDecimal c = BigDecimal.TEN;
|
||||
|
||||
|
@ -173,11 +173,11 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("B is 1 (B = A)")
|
||||
@Nested
|
||||
class B_is_1 {
|
||||
final class B_is_1 {
|
||||
|
||||
@DisplayName("C is 0 (B = A > C)")
|
||||
@Nested
|
||||
class C_is_0 {
|
||||
final class C_is_0 {
|
||||
|
||||
BigDecimal c = BigDecimal.ZERO;
|
||||
|
||||
|
@ -204,7 +204,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("C is 1 (B = A = C)")
|
||||
@Nested
|
||||
class C_is_1 {
|
||||
final class C_is_1 {
|
||||
|
||||
BigDecimal c = BigDecimal.ONE;
|
||||
|
||||
|
@ -231,7 +231,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("C is 10 (B = A < C)")
|
||||
@Nested
|
||||
class C_is_10 {
|
||||
final class C_is_10 {
|
||||
|
||||
BigDecimal c = BigDecimal.TEN;
|
||||
|
||||
|
@ -306,11 +306,11 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("B is 10 (B > A)")
|
||||
@Nested
|
||||
class B_is_10 {
|
||||
final class B_is_10 {
|
||||
|
||||
@DisplayName("C is 0 (B > A > C)")
|
||||
@Nested
|
||||
class C_is_0 {
|
||||
final class C_is_0 {
|
||||
|
||||
BigDecimal c = BigDecimal.ZERO;
|
||||
|
||||
|
@ -337,7 +337,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("C is 1 (B > A = C)")
|
||||
@Nested
|
||||
class C_is_1 {
|
||||
final class C_is_1 {
|
||||
|
||||
BigDecimal c = BigDecimal.ONE;
|
||||
|
||||
|
@ -364,7 +364,7 @@ public class ComparableUtilsTest extends AbstractLangTest {
|
|||
|
||||
@DisplayName("C is 10 ([B,C] > A)")
|
||||
@Nested
|
||||
class C_is_10 {
|
||||
final class C_is_10 {
|
||||
|
||||
BigDecimal c = BigDecimal.TEN;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public abstract class AbstractConcurrentInitializerTest extends AbstractLangTest
|
|||
final ConcurrentInitializer<Object> initializer = createInitializer();
|
||||
final int threadCount = 20;
|
||||
final CountDownLatch startLatch = new CountDownLatch(1);
|
||||
class GetThread extends Thread {
|
||||
final class GetThread extends Thread {
|
||||
Object object;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -56,7 +56,7 @@ import org.apache.commons.lang3.reflect.testbed.StringParameterizedChild;
|
|||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class AAAClass extends AAClass<String> {
|
||||
final class AAAClass extends AAClass<String> {
|
||||
public class BBBClass extends BBClass<String> {
|
||||
// empty
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ class AAClass<T> {
|
|||
|
||||
@SuppressWarnings("rawtypes")
|
||||
//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
|
||||
public interface AInterface<T> {
|
||||
|
|
Loading…
Reference in New Issue