Clear description of my expectations versus reality
Expectation: having annotation @DiffIgnoreProperties on your class does not affect the JaversType resolution for said class.
Reality: with @DiffIgnoreProperties on your class, no type annotations (e.g. @ValueObject, @Entity) will be recognized, which may affect JaversType resolution (in case the deduced type differs from the one declared via the type annotation).
Steps To Reproduce
I have a runnable test case which isolates the bug and allows Javers Core Team to easily reproduce it. I have pushed this test case to my fork of this repository:
https://github.com/kirmerzlikin/javers/tree/diff-ignore-properties-bug/javers-core/src/test/groovy/org/javers/core/cases/Case1287ValueObjectWithIgnoredProperties.groovy
Javers' Version
7.0.0
Additional context
This bug is caused by the change made in scope of PR #1267 that introduced the annotation @DiffIgnoreProperties (initially called @DiffIgnoreFields) to JaVers. In that PR this annotation was added to the list of annotations detected by ClassAnnotationsScanner which are supposed to declare a class as a certain JaversType. Since only first of the found annotations from that list is used, and since @DiffIgnoreProperties appears early in that list, it prevents other annotations from being recognized. The problem here is that @DiffIgnoreProperties shouldn't be in that list at all, since it's not meant to be an indicator of a JaversType.
I have a fix for this bug in the branch diff-ignore-properties-fix of my fork and will be happy to submit a PR here.
Clear description of my expectations versus reality
Expectation: having annotation
@DiffIgnorePropertieson your class does not affect the JaversType resolution for said class.Reality: with
@DiffIgnorePropertieson your class, no type annotations (e.g.@ValueObject,@Entity) will be recognized, which may affect JaversType resolution (in case the deduced type differs from the one declared via the type annotation).Steps To Reproduce
I have a runnable test case which isolates the bug and allows Javers Core Team to easily reproduce it. I have pushed this test case to my fork of this repository:
https://github.com/kirmerzlikin/javers/tree/diff-ignore-properties-bug/javers-core/src/test/groovy/org/javers/core/cases/Case1287ValueObjectWithIgnoredProperties.groovy
Javers' Version
7.0.0
Additional context
This bug is caused by the change made in scope of PR #1267 that introduced the annotation
@DiffIgnoreProperties(initially called@DiffIgnoreFields) to JaVers. In that PR this annotation was added to the list of annotations detected byClassAnnotationsScannerwhich are supposed to declare a class as a certain JaversType. Since only first of the found annotations from that list is used, and since@DiffIgnorePropertiesappears early in that list, it prevents other annotations from being recognized. The problem here is that@DiffIgnorePropertiesshouldn't be in that list at all, since it's not meant to be an indicator of a JaversType.I have a fix for this bug in the branch
diff-ignore-properties-fixof my fork and will be happy to submit a PR here.