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
使用1.2.21 的SkipTransientField不起作用 #944
Labels
Milestone
Comments
能提供重现问题的testcase么? |
public class JsonObjectTest {
private String name;
private Integer age;
private Date time;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Transient
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public static void main(String[] args) {
JsonObjectTest jsonObjectTest = new JsonObjectTest();
jsonObjectTest.setTime(new Date());
jsonObjectTest.setAge(3);
jsonObjectTest.setName("abc");
String s=JSONObject.toJSONString(jsonObjectTest, SerializerFeature.SkipTransientField);
System.out.println(s);
}
} 然后输出是: |
已经支持java.beans.Transient,请等待1.2.23版本 |
This was referenced Mar 12, 2021
Closed
asa1997
pushed a commit
to Be-Secure/fastjson
that referenced
this issue
Feb 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
transient的属性依然被序列化,应该是要忽略掉transient的属性
The text was updated successfully, but these errors were encountered: