All notable changes to this project will be documented in this file.
- Removed direct dependency on ASM by re-writing the annotation processor to Byte-Buddy. (Issue 208)
- EqualsVerifier's test suite now runs on Java 12 EA. (Issue 209)
3.0.3 - 2018-11-16
- An incorrect
module-infowas shaded into the jar file. (Issue 222)
3.0.2 - 2018-10-31
java.timefields cause illegal reflective access warning on Java 9+: added prefab values. Issue 217)
3.0.1 - 2018-10-29
java.net.URIfields cause illegal reflective access warning on Java 9+: added prefab values. (Issue 214)
- Java 11 support is no longer experimental because internal ASM dependency is updated to version 7.0.
- Updated internal ASM dependency to version 7.0, so Java 11 support is no longer experimental.
3.0 - 2018-09-26
If you're upgrading from EqualsVerifier 2.x, please see the migration guide.
- Full support for Java 11. (Issue 197)
- Re-usable EqualsVerifier configurations: see the manual.
#report()method to ask EqualsVerifier for a report, instead of making it fail a test.
#withGenericPrefabValues()method added to supply values for specific generic types: see here.
- Error messages are more readable, because:
- the name of a failing class is mentioned more clearly in the error message (Issue 202);
- the error message no longer edits out EqualsVerifier-internal calls from the stack trace;
- the layout of the text in the error messages has been improved.
- Perfomance improvements. (Issue 190; see also this tweet)
- Code base now uses Java 8 language features.
- JavaDoc has been updated.
- Support for Java 7.
Warning.ANNOTATION, because it's no longer needed.
- The annoying license and copyright headers in each file. (Don't worry: EqualsVerifier is still licensed under the Apache 2.0 license!)
java.util.concurrent.atomic.Atomic*and some RMI-specific fields cause illegal reflective access warnings on Java 9+: added prefab values. (Issue 207)
2.5.2 - 2018-08-17
java.sql.Timestampcause illegal reflective access warnings on Java 9+: added prefab values.
2.5.1 - 2018-08-05
- AssertionError when class under test has stateless fields: you can now use
#withIgnoredFields(). (Issue 203)
2.5 - 2018-07-30
Warning.ALL_NONFINAL_FIELDS_SHOULD_BE_USEDwhen only the final fields are relevant to your
equalsmethod. (Issue 200)
- Using both abstract methods and lazy iniitalizers throws an unexplained
NullPointerException. (Issue 201)
- Empty enum fields throw
ReflectionException. (Issue 199)
2.4.8 - 2018-07-04
- Java NIO buffer fields cause Significant field error. (Issue 198)
- Java 11 compatibility. (Issue 197)
2.4.7 - 2018-06-20
- Performance improvements, because part of the processing of annotations is now cached. (Issue 190; thanks Андрей!)
java.lang.Threadfields cause illegal reflective access warning on Java 9+: added prefab values. (Issue 193)
@Transientfields are not ignored, as discussed in the manual. (Issue 196)
2.4.6 - 2018-04-28
- An AWT frame pops up while EqualsVerifier is running. (Issue 192)
2.4.5 - 2018-03-20
- Updates internal Byte Buddy dependency to support Java 10 GA. (Issue 189; thanks Vincent!)
2.4.4 - 2018-03-12
- Initial support for Java 10.
- Support for building and releasing EqualsVerifier from Java 9.
2.4.3 - 2018-02-03
- Support for Guava 24's Multisets. (Issue 185; thanks Stephan!)
2.4.2 - 2018-01-20
- AWT classes cause illegal reflective access warnings on Java 9+, and recursive data structure errors: prefab values added. (Issue 183)
2.4.1 - 2018-01-12
- EqualsVerifier's test suite (and probably your own EqualsVerifier tests!) now run on Java 9 without any illegal reflective access warnings. (Issue 172)
2.4 - 2017-11-11
- An official Java 9 module name:
- Initial support for Java 10 Early Access. (Issue 177; thanks Vincent!)
2.3.3 - 2017-08-24
- Chaining calls to
#withOnlyTheseFieldsthrows IllegalArgumentException. (Issue 171; thanks Nathan!)
- Having a field from the Java library's
org.w3c.dompackage throws IllegalArgumentException. (Issue 174)
- EqualsVerifier's jar file is smaller again due to better Maven support of Java 9. (Issue 152, Comment 18)
2.3.2 - 2017-08-06
- Support for Java 9. (Issue 152)
2.3.1 - 2017-07-03
hashCodein JPA entities no longer cause an error. (Issue 170)
2.3 - 2017-05-24
#withIgnoredAnnotationsto disable specific annotations. For instance, you can disable
@Nonnullto gain 100% test coverage on
equalsmethods generated by Lombok. (Mailinglist threads 1 and 2; for more info see 'Coverage is not 100%')
- Support for classes derived from classes that live in a signed jar. (Issue 163)
MANIFEST.MFfile is back in the EqualsVerifier jar. (Issue 169)
2.2.2 - 2017-04-03
java.inet.InetAddressfields cause "Cannot inject classes into the bootstrap class loader" error. (Issue 168)
- Fields of other types also cause class loader errors. (Also issue 168)
2.2.1 - 2017-01-29
- Fields of
Maptype where a single value enum is used as key. (Issue 166)
2.2 - 2017-01-14
#withNonnullFields()to be more specific about which fields may be null. (Issue 134)
- Error messages are more helpful.
- Uninitialized static arrays cause NullPointerException. (Issue 165)
2.1.8 - 2016-12-13
- Classes that implement an abstract class that calls an abstract method in its
hashCodemethod, throw AbstractMethodError when EqualsVerifier is called with
#usingGetClass(). (Issue 161)
2.1.7 - 2016-11-18
- Single value enums cause Significant fields error. (Issue 157; thanks Stephan!)
2.1.6 - 2016-10-01
- Annotations which are available at compile-time but not at run-time sometimes throw NullPointerException. (Issue 153 and Issue 154)
2.1.5 - 2016-08-06
java.util.Stackfields throw ArrayIndexOutOfBoundsException. (Issue 151)
2.1.4 - 2016-07-25
- Full generics support for Guava's
Range. (Issue 150; thanks Stephan!)
2.1.3 - 2016-07-17
- Older versions of Google Guava cause ReflectionException. (Issue 149)
2.1.2 - 2016-06-20
- Race condition when EqualsVerifier is run concurrently. (Issue 148; thanks Borys!)
2.1.1 - 2016-06-14
- Updated ByteBuddy dependency. (Issue 145; thanks Vincent!)
- In certain situations, for example when running unit tests with coverage in IntelliJ, VerifyErrors are thrown. (Issue 147)
2.1 - 2016-05-22
Warning.STRICT_HASHCODEto let EqualsVerifier allow
hashCodemethods that don't use all the fields that are also used in
equals, or even constant
hashCodes. (Issue 142)
- Unexpected behaviour when a class's
hashCodeasserts on the length of its array field. (Issue 143)
- Objenesis's meta-data carries into EqualsVerifier's jar file's
META-INFfolder. (Issue 144)
- EqualsVerifier throws ReflectionException when it's unable to read annotations on fields in certain situations. (Issue 114, Comment 21)
2.0.2 - 2016-04-03
- Classes that implement an abstract class that calls an abstract method in its
hashCodemethod, throws AbstractMethodError. (Issue 138)
javax.naming.Referencethrows IllegalStateException on certain JVMs. (Issue 114)
2.0.1 - 2016-03-13
com.google.code.findbugs.annotationsdependency now has
providedscope. (Issue 135; thanks Stephan!)
- Classes that have a static final reference to a recursive data structure, without adding a prefab value.
- Classes that have a generic parameter that extends
Comparablethrow IllegalArgumentException. (Issue 136)
2.0 - 2016-03-06
If you're upgrading from EqualsVerifier 1.x, please see the migration guide.
#withIgnoredFields()to disregard specific fields, while expecting all remaining fields to be used in
#withOnlyTheseFields()to expect that the given fields are used, and that the remaining fields are not used. (Issue 128)
Warning.ALL_FIELDS_SHOULD_BE_USEDto suppress Significant field errors.
- EqualsVerifier fails when
equalsisn't overridden (i.e., inherited directly from
Object). (Issue 66)
Warning.INHERITED_DIRECTLY_FROM_OBJECTto revert back to the old behaviour.
- 'All fields should be used' is now the default behaviour. (Issue 65)
- EqualsVerifier puts more useful information on the stack trace if it fails.
- Replaced internal dependency to CGLib with Byte Buddy, for better support of Java 8. (Issue 115)
- Improved EqualsVerifier's code quality by adding Checkstyle and FindBugs, and doing mutation tests with PIT.
- Support for Java 6.
EqualsVerifier#debug(). (It didn't do anything anymore, anyway.)
- Referring to the generic contents of containers such as
Optionalin the implementation of
hashCodecan throw ClassCastException. (Issue 84)
1.7.8 - 2016-12-26
- EqualsVerifier throws RuntimeException when used together with Java 8's
1.7.7 - 2016-01-18
- EqualsVerifier throws NullPointerException when used together with Cobertura. (Issue 132)
1.7.6 - 2015-12-21
- EqualsVerifier gives 100% mutation coverage with PIT on your
hashCodemethods. (Issue 131)
- Implementing an interface that defines
equalscauses Reflexivity error. (Issue 130)
1.7.5 - 2015-08-29
- EqualsVerifier gives Symmetry errors if the symmetry violation only occurs in the subclass of a versioned entity. (Issue 123, Comment 10)
- EqualsVerifier gives a warning when the id check on a versioned entity is implemented incorrectly. (Issue 123, Comment 17)
Warning.NONFINAL_FIELDSon classes marked
@MappedSuperclassis no longer needed. (Issue 124 and Issue 123, Comment 15)
- EqualsVerifier throws NullPointerException on singleton enum fields. (Issue 125)
1.7.4 - 2015-08-17
- JavaFX fields (on Java 8) cause RecursionException: added prefab values. (Issue 120)
javax.naming.Referencefields cause ClassCastException: added prefab value. (Issue 118)
- SBT throws ClassNotFoundException when running EqualsVerifier. (Issue 119)
- Reporting on subclasses of versioned entities. (Issue 123)
1.7.3 - 2015-07-18
cachedHashCodefield can now have protected or default visibility for
#withCachedHashCode(). (Issue 110)
- Several behind-the-scenes improvements :).
- Static final fields with value
nullthrow NullPointerException. (Issue 116)
1.7.2 - 2015-03-28
- Support for Eclipse's JDT null annotations, including the Java 8 style type annotations.
- All internal dependencies have been updated. (Issue 107)
- Static fields with an empty array throw ArrayIndexOutOfBoundsException. (Issue 106)
- Several potential bugs, using PIT.
1.7.1 - 2015-03-11
- EqualsVerifier throws Reflexivity errors (which then need to be suppressed with version 1.7's
1.7 - 2015-03-04
#withCachedHashCode()to verify classes that cache their
hashCode. (Issue 60; thanks Niall!)
Warning.NO_EXAMPLE_FOR_CACHED_HASHCODEto avoid giving an example value for
#withCachedHashCode(). (Issue 60)
- An error message when you accidentally use
equalson an object field inside the
equalsmethod. (Issue 104)
Warning.REFERENCE_EQUALITYto suppress the above error. (Issue 104)
- Several Java Collections interface classes, including
TreeSet, throw AbstractMethodError: added prefab values. (Issue 103)
1.6 - 2015-01-17
- Support for default
@Nonnullannotations. (Issue 50)
- Using FindBugs's
- Using a JSR 305 annotation (see this StackOverflow question),
- Placing them either on the class or on the package,
- With the ability to override the default annotation by placing
@CheckForNullon a field.
- Using FindBugs's
- Check for
hashCodeconsistency when object is stateless. (Issue 97)
- Support for classes where equality is fully defined in a superclass, for example using Apache Commons's
EqualsBuilder.reflectionEquals. (Issue 102)
- Stateless classes cause Precondition error. (Issue 46)
- Classes with stateless fields cause Precondition error. (Issue 100 and Issue 101)
1.5.1 - 2014-12-05
- EqualsVerifier now build with Maven instead of ANT+Ivy.
- Dependency issues when incompatible versions of ASM and/or CGLib are on the classpath: EqualsVerifier is now shipped as an "uber jar" which contains all its dependencies inside. (Issue 96)
- EqualsVerifier throws ReflectionException with older versions of Google Guava on the classpath. (Issue 98)
1.5 - 2014-08-20
- Support for Java 8! Classes containing Java 8 language features are now supported, and prefab values for new Java 8 API classes have been added. (Issue 92)
- Improved error messages when
hashCodeare themselves abstract.
- Heavily refactored EqualsVerifier's unit tests to make them easier to find and understand.
- Classes from Joda-Time and Google Guava throw AbstractMethodError: added prefab values. (Issue 83)
- Multi-dimensional arrays cause incorrect error messages. (Issue 90 and Issue 94)
Objectfields doesn't work; only
Arrays#deepEquals()does. (Issue 94)
equals. (Issue 95; thanks Dean!)
1.4.1 - 2014-03-18
- Improved EqualsVerifier's unit tests for reflexivity and symmetry, to catch small mistakes such as the one in Issue 88.
- Verifying an enum causes Identical Copy and Symmetry errors. (Issue 87)
1.4 - 2013-12-27
#allFieldsShouldBeUsedExcept()to specifically ignore certain fields. (Issue 82)
- EqualsVerifier now covers 100% of your
- Error messages around abstract delegation are clearer. This clarifies especially classes that contain Joda-Time
- Classes that have an array field but don't declare an
equalsmethod cause an error.
java.util.BitSetfields cause ArrayIndexOutOfBoundsException: added prefab value. (Issue 86)
1.3.1 - 2013-06-09
Warning.IDENTICAL_COPY_FOR_VERSIONED_ENTITYwhich can be suppressed when testing "versioned entity" classes where a zero id field indicates that the object is new. (Issue 80)
- Explanations for EqualsVerifier's error messages can now be read on the new EqualsVerifier website at jqno.nl, which matches EqualsVerifier's fully qualified name:
- Transitivity errors are more accurate. (Issue 78)
- Exceptions thrown in
#toString()break EqualsVerifier. (Issue 79)
java.util.UUIDfields cause Recursion error: added prefab value. (Issue 81)
#debug(), because relevant exceptions are now included as a cause in the stack trace.
1.3 - 2013-06-09
Please don't use version 1.3; it's a broken release. Use 1.3.1 instead.
1.2 - 2013-03-26
- EqualsVerifier no longer fails on single value enums (and hence, singletons), even if they don't count for
hashCode. (Issue 74)
- EqualsVerifier can now be built using Ant 1.9. (Issue 76)
||) pass. (Issue 75; blog post about the problem and the solution)
- Errors when the
toStringmethod of the class under test throws exceptions.
- Classes containing null fields throw NullPointerExample in
#forRelaxedEqualExamples. (Issue 73)
- Some false negatives when running EqualsVerifier's test suite. (Issue 77)
1.1.4 - 2013-01-14
- Fork EqualsVerifier on GitHub! The code has been moved to GitHub. The project frontpage will remain on Google Code.
- Error messages on Abstract Delegation are more informative: EqualsVerifier now also mentions the name of the abstract method that was called.
- Issue when the class under test has a superclass that has no declarations for
hashCode. (Issue 63)
- No error when using
#allFieldsShouldBeUsed()and the class under test has fields, but no declarations for
hashCode(and hence doesn't use these fields). (Issue 67)
1.1.3 - 2012-04-21
#allFieldsShouldBeUsed()includes static fields. EqualsVerifier will now no longer complain if these static fields aren't used in your
hashCodemethods. (Issue 57)
- EqualsVerifier passes when an
equalsmethod works incorrectly if a field in the class under test is null. (Issue 59)
1.1.2 - 2012-03-01
- EqualsVerifier recursively changes the value of non-final static fields, causing other tests to fail. (Issue 55, Comment 8)
1.1.1 - 2012-02-21
Warning.IDENTICAL_COPY, to suppress when you want to use reference equality in an overridden
equalsmethod. (Issue 56)
1.1 - 2012-02-11
#allFieldsShouldBeUsed()to get a warning if you forgot to include a field in
hashCodemethod. (Issue 53)
- EqualsVerifier passes when you include a reference-equality check (
this == obj), followed by an incorrect instanceof check in your
equalsmethod. EqualsVerifier will now notice if you do an instanceof check for a class other than the one that you are testing. (Issue 55, Comment 2)
- EqualsVerifier changes the values of non-final static fields, causing other tests to fail. (Issue 52 and Issue 55)
Collectionfields give unjustified warnings: added prefab values. (Issue 49 and Issue 51)
1.0.2 - 2011-08-14
- EqualsVerifier is now in Maven Central! (Issue 36)
- EqualsVerifier passes when you forget to include an
instanceofcheck or a
getClass()check in your
equalsmethod. (Issue 47)
- EqualsVerifier throws AbstractMethodError on a class whose superclass has abstract declarations for
hashCode. (Issue 48)
1.0.1 - 2011-04-17
Warning.ANNOTATIONto disable annotation processing. This is useful for dynamically generated classes. (Issue 41)
- Issue when EqualsVerifier tests a class that is a subclass of one of the classes from
rt.jar, which are loaded by the system classloader. (Issue 43)
- EqualsVerifier fails on classes with
doublefields but no
equalsmethod. (Issue 44)
Exceptionfields cause Recursion error: added prefab values. (Issue 45)
1.0 - 2011-02-23
- Support for annotations. Use any of the following annotations on your classes and fields: EqualsVerifier will know what to do!
@Immutable: EqualsVerifier will not complain about non-final fields if your class is
@Immutable. (It doesn't matter in which package the annotation is defined;
net.jcip.annotations.Immutableor your own implementation will all work fine.)
@NotNull: EqualsVerifier will not check for potential
NullPointerExceptions for any field marked with any of these annotations. (Again: the source package doesn't matter.) This is similar to calling
#suppress(Warning.NULL_FIELDS), but on a per-field basis, instead of all-or-nothing. (Issue 28)
@Entity: EqualsVerifier will not complain about non-final fields if your class is a JPA Entity. Note that this only works for
javax.persistence.Entity, not for
Entityannotations from other packages. (Issue 37)
@Transient: Fields marked with this annotation (again, only from
javax.persistence.Transient), will be treated the same as fields marked with Java's
transientmodifier; i.e., EqualsVerifier will complain if they are used in the
- EqualsVerifier now shows the name of the field that throws a potential NullPointerException. (Issue 39)
- EqualsVerifier detects recursive data structures where there are none. (Issue 34)
BigIntegerfields cause Recursion error: added prefab values. (Issue 34)
0.7 - 2010-11-15
equalsmethods that use a call to
getClass()instead of an
instanceofcheck to determine the type of the object passed in.
- EqualsVerifier warns when you use a transient field in your
hashCodemethod. Don't worry, you can suppress this warning too.
- Error messages contain a link to the Error messages page to get more help.
- The back end is almost completely re-written.
- Certain Java API classes, like
Pattern, cause Recursion error: added prefab values.
- Many Javadoc improvements (including the one in Issue 32).
0.6.5 - 2010-08-05
- EqualsVerifier now contains an internal list of prefab values for a wide variety of Java API types, to avoid getting 'Recursive datastructure' errors all the time. (Issue 30)
- Error messages when
toStringthrows something other than a NullPointerException when one of the fields is
null, are now more helpful. (Issue 31)
0.6.4 - 2010-06-13
- Error message that a certain field is used in
equalsbut not in
hashCodeor the other way around, when really
Arrays.deepHashCode()should have been used. (Issue 27)
- Many non-nullity errors on
0.6.3 - 2010-05-18
- EqualsVerifier gives hashCode error on classes that don't override
hashCode. (Issue 23)
- IllegalAccessException when EqualsVerifier is used together with the EclEmma code coverage tool. (Issue 22)
- Classes that contain (indirect) references to non-static inner classes cause recursive data structure errors. (Issue 21)
0.6.2 - 2010-02-11
- Regression with
#withPrefabValues()for recursive data structure fields in superclasses. (Issue 20)
0.6.1 - 2010-02-06
#verify()more quickly using autocompletion in IDEs.
- Regression with
#withPrefabValues()for fields which delegate to abstract methods. (Issue 14)
0.6 - 2010-01-30
- The API is more consistend.
#suppress(Warning), which feels more Java-y. Former features that were not warnings, are now proper methods on
- Error messages have been improved:
- many messages now span multiple lines for improved readability;
- hashCodes are printed (where relevant);
- unexpected exceptions are no longer eaten by EqualsVerifier, so they can be read without calling
- calls to abstract methods from within
hashCode, which cannot be resolved, are now detected and properly reported. (Issue 14)
- EqualsVerifier fails on classes that contain fields whose
equalsmethods might throw NullPointerExceptions. (Issue 19)
- EqualsVerifier detects recursive data structures where there are none. (Issue 18)
Classfields throw IllegalAccessError: added prefab value. (Issue 17)
0.5 - 2009-09-01
- EqualsVerifier is now compiled with debug information, so you can step through the source in Eclipse after adding the EqualsVerifier jar to your project. (Issue 11)
- Fields of interface of abstract class types (such as Lists and other Collection types) throw InstantiationError. (Issue 12)
0.4 - 2009-08-29
#withRelaxedEqualExamples()to verify equality rules that are more relaxed than simple field-by-field comparisons. (Issue 9)
0.3 - 2009-08-01
- EqualsVerifier now recursively instantiates objects so
#withPrefabValues()is now only needed for actual recursive data structures. (Issue 7)
0.2 - 2009-07-03
- EqualsVerifier now checks if
Arrays.deepEquals()was used for multidimensional and
Objectarrays. (Issue 3)
- Optional features are now accessed through a clean enum instead of through lots of different method calls. (Issue 4)
- EqualsVerifier can now be used in unit test frameworks other than JUnit 4. (Issue 5)
- Stack traces are now printed to
System.err. (Issue 6)
- Can't use the fields are never null feature on classes instantiated with
#forClass(). (Issue 1)
0.1 - 2009-06-01
You can now use EqualsVerifier!