-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@DiffIgnoreProperties prevents @ValueObject and other type annotations from being detected #1287
Comments
hi @kirmerzlikin , thanks for a high quality bug report and a possible fix, could you please create a PR? |
hi @bartoszwalacik, did you have a chance to take a look at the PR? |
Hi @kirmerzlikin , sorry for the delay, I will take a look at this in this week |
bartoszwalacik
pushed a commit
that referenced
this issue
Jul 10, 2023
bartoszwalacik
pushed a commit
that referenced
this issue
Jul 10, 2023
@kirmerzlikin thanks for this fix, it's brilliant, I will release it tomorrow in javers-7.0.3 |
bartoszwalacik
pushed a commit
that referenced
this issue
Jul 16, 2023
bartoszwalacik
pushed a commit
that referenced
this issue
Jul 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 byClassAnnotationsScanner
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.The text was updated successfully, but these errors were encountered: