Skip to content
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

@JsonbTransient does not work on abstract classes #454

Open
rmanibus opened this issue Oct 26, 2020 · 1 comment
Open

@JsonbTransient does not work on abstract classes #454

rmanibus opened this issue Oct 26, 2020 · 1 comment
Labels
bug Something isn't working right

Comments

@rmanibus
Copy link

Describe the bug

@JsonbTransient work on interfaces but not on abstract classes.

To Reproduce
reproducer:

https://github.com/rmanibus/quarkus_12926

Expected behavior
Fields annotated with @JsonbTransient are ignored.

System information:

  • OS: [e.g. Linux, Windows, Mac]
  • Java Version: [e.g. 8, 11]
  • Yasson Version: [e.g. 1.0.5]

Additional context
Add any other context about the problem here.

@jbescos
Copy link
Member

jbescos commented Aug 24, 2022

I was debugging this and with the abstract class it is analyzed twice, one for the abstract and other for the anonymous class.

In the abstract class it is able to find the JsonbTransient but it is not getting that from the anonymous class that extends the abstract class. This org.eclipse.yasson.internal.model.JsonbAnnotatedElement#getAnnotations() returns empty array

For the interface, it is analyzed only one time, having that annotation.

I guess the fix is about getting the annotations from the parent classes too.

jbescos added a commit to jbescos/yasson that referenced this issue Aug 24, 2022
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Verdent pushed a commit that referenced this issue Aug 26, 2022
@JsonbTransient does not work on abstract classes #454

Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants