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

WIP Fix JsonbTransient not working on superclass inherited properties #465

Closed
wants to merge 2 commits into from
Closed

Conversation

Degubi
Copy link
Contributor

@Degubi Degubi commented Dec 28, 2020

Fixes #454

  • Add code for checking if a property is transient in the base class
  • Borrow code from issue and add it as test

All tests are passing, but I would like to know if this might break something else...

Edit: I looked around this, trying out things with interfaces & abstract classes. Not sure what is the intended behavior here, so I marked this pr 'WIP'
e.g:

This class:

public final class TransientPropertyChildUsingInterface {

    @Override
    public String getTransientAbtractProperty() {
        return "aaa";
    }

    @Override
    public String getNormalAbstractProperty() {
        return "bbb";
    }
}

When implementing this interface:

public interface TransientPropertyInterface {

    @JsonbTransient
    String getTransientAbtractProperty();

    String getNormalAbstractProperty();

    @JsonbTransient
    default String getTransientDefaultProperty() {
        return "hey";
    }

    default String getNormalDefaultProperty() {
        return "ho";
    }
}

Gives: {"normalAbstractProperty":"bbb","normalDefaultProperty":"ho"}
This is the same before & after this pr's changes

But when extending this class:

public abstract class TransientPropertySuperclass {

    @JsonbTransient
    public abstract String getTransientAbtractProperty();

    public abstract String getNormalAbstractProperty();

    @JsonbTransient
    String getTransientDefaultProperty() {
        return "hey";
    }

    String getNormalDefaultProperty() {
        return "ho";
    }
}

After the pr only gives: {"normalAbstractProperty":"bbb"}
Before the pr: {"normalAbstractProperty":"bbb","transientAbtractProperty":"aaa"}

@Degubi Degubi changed the title Fix JsonbTransient not working on superclass inherited properties WIP Fix JsonbTransient not working on superclass inherited properties Dec 30, 2020
@Verdent
Copy link
Member

Verdent commented May 25, 2021

Hi @Degubi , thank you for taking care of this issue! :-) May I ask if there is any progress?

@Degubi
Copy link
Contributor Author

Degubi commented May 25, 2021

Hi @Verdent!
When I saw the output I got confused over what the intended output was supposed to be, so I stopped working on this. :/

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@JsonbTransient does not work on abstract classes
2 participants