- Exception Handling: Reimplemented property access exception handling
- Inclusion: Implemented a mechanism to control the inclusion of properties of specific object types.
- Inclusion: Implemented a mechanism to register custom inclusion resolvers to support inclusion rules far beyond the built-in ones.
- Introspection: Implemented a mechanism to register a custom instance factory, which is used by
DiffNode#canonicalSet
in order to create instances of missing objects
- Inclusion: Performance improvements (Thanks @Deipher)
- Inclusion:
InclusionService
has been split into severalInclusionResolver
s - DiffNode:
canonicalSet
now automatically creates missing objects along the path to the root object
- Circular Reference Detection: Fixed 'Detected inconsistency in enter/leave sequence. Must always be LIFO.' bug that could occur due to inconsistent cleanup of the instance memory when a circular reference has been detected.
-
[#66] The signature of compared objects is now determined at runtime whenever possible. The signature of bean property values used to simply be the one of its getters return type. The object differ now does its best to determine the most specific shared object type. It does this like so:
- If the object types of base and working are the same, the signature of this type will be used for introspection. (1)
- If the object types of base and working are different, the signature of their closest shared superclass will be used. (2)
- If no shared superclass could be found, it falls back the the declared return type of the objects property getter. (3)
The runtime type analysis will not consider shared interfaces, so the only way to diff exclusively against interface signatures, is to cause the type lookup to fall through to (3). Currently I'm not sure if it needs to be possible to force the object differ to always use the declared type. If you think it does or this new behavior causes you any trouble, please let me know.
- Fixed Java 5 incompatibility (replaced
Deque
withLinkedList
)
- Added Maven Plugin to verify Java 5 API compatibility
- Added a method to
PropertyNode
to return all annotations of its accessor [#46] - Circular nodes now provide access to the node where the circle started [#52]
- Allowed to configure the way circular references are detected. Objects can now either be matched as usual via equality operator or alternatively via equals method
- Added an example to demonstrate the difference between
Node#get(Object)
andNode#canonicalGet(Object)
- Lowered minimum required Java version from Java 6 to 5 [#51]
- The library is now packaged in an OSGi-compliant way [#53]
- Fixed a bug that caused
Maps
andCollections
to be improperly compared in case they were configured to use the equals only comparison strategy
- Major refactoring of most core classes to allow for better extendability and testability
- Increased test coverage
- Added some more code examples
- Upgraded to latest versions of SLF4J, Mockito and TestNG
- Ignored properties will no longer be accessed (regression)
- Starting from this release
java-object-diff
will be available via Maven Central repository
logback.xml
is no longer included in the JAR file
- It is now possible to retrieve the property graph of added and removed nodes
- Collections and Maps of different types can now be properly compared
- Added configuration option to allow primitive default values to be treated like
null
objects or regular values
- Switched from JUnit to TestNG
- Accessors now have a neat toString representation
- Changed output format of printing visitors a little bit
- The
ADDED
andREMOVED
state of object nodes is now simplynull
based (default values won't be taken into account anymore) - Private constructors can now be accessed to determine the default values of primitive properties
- Primitive types are now handled in a more intuitive way