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

父类字段定义了忽略字段后,子类继承get方法忽略字段不生效,导致死循环 #2914

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

ywzou
Copy link
Contributor

@ywzou ywzou commented Sep 2, 2024

父类字段定义了忽略字段后,子类继承get方法忽略字段不生效,导致死循环

public static abstract class AbstractJsonEntity {
    @JSONField(serialize = false)
    private String url;

    get/set
}


public class UrlEntity extends AbstractJsonEntity {
    private String name;
    
    @Override
    public String getUrl() {
         // 导致死循环
        String text = JSON.toJSONString(this);
    }
}

父类字段定义了忽略字段后,自定继承get方法忽略字段不生效,导致死循环
@wenshao
Copy link
Member

wenshao commented Sep 2, 2024

Issue1513 这个单测没跑过,你在本地运行mvn test修复下问题

进一步处理继承get方法死循环问题
@wenshao wenshao merged commit 732b866 into alibaba:main Sep 4, 2024
5 checks passed
@wenshao wenshao added this to the 2.0.53 milestone Sep 4, 2024
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.

2 participants