Mageia Bugzilla – Attachment 7774 Details for
Bug 18382
jackson-dataformat-xml new security issue CVE-2016-3720
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Suggested java insert for test program
pojo (text/plain), 1.29 KB, created by
Len Lawrence
on 2016-05-10 08:44:12 CEST
(
hide
)
Description:
Suggested java insert for test program
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2016-05-10 08:44:12 CEST
Size:
1.29 KB
patch
obsolete
>// http://stackoverflow.com/questions/3527264/how-to-create-a-pojo > >public class Data >{ >private int id; >private String deptname; >private String date; >private String name; >private String mdate; >private String mname; > >public int getId() { > return id; >} > >public void setId(int id) { > this.id = id; >} > >public String getDeptname() { > return deptname; >} > >public void setDeptname(String deptname) { > this.deptname = deptname; >} > >public String getDate() { > return date; >} > >public void setDate(String date) { > this.date = date; >} > >public String getName() { > return name; >} > >public void setName(String name) { > this.name = name; >} > >public String getMdate() { > return mdate; >} > >public void setMdate(String mdate) { > this.mdate = mdate; >} > >public String getMname() { > return mname; >} > >public void setMname(String mname) { > this.mname = mname; >} > >} > >// https://github.com/FasterXML/jackson-dataformat-xml > >public class Simple { > public int x = 1; > public int y = 2; >} > >// Important: create XmlMapper; it will use proper factories, workarounds >ObjectMapper xmlMapper = new XmlMapper(); >String xml = xmlMapper.writeValueAsString(new Simple()); > >// deserialization > >ObjectMapper xmlMapper = new XmlMapper(); >Simple value = xmlMapper.readValue("<Simple><x>1</x><y>2</y></Simple>", Simple.class);
// http://stackoverflow.com/questions/3527264/how-to-create-a-pojo public class Data { private int id; private String deptname; private String date; private String name; private String mdate; private String mname; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getDeptname() { return deptname; } public void setDeptname(String deptname) { this.deptname = deptname; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMdate() { return mdate; } public void setMdate(String mdate) { this.mdate = mdate; } public String getMname() { return mname; } public void setMname(String mname) { this.mname = mname; } } // https://github.com/FasterXML/jackson-dataformat-xml public class Simple { public int x = 1; public int y = 2; } // Important: create XmlMapper; it will use proper factories, workarounds ObjectMapper xmlMapper = new XmlMapper(); String xml = xmlMapper.writeValueAsString(new Simple()); // deserialization ObjectMapper xmlMapper = new XmlMapper(); Simple value = xmlMapper.readValue("<Simple><x>1</x><y>2</y></Simple>", Simple.class);
View Attachment As Raw
Actions:
View
Attachments on
bug 18382
:
7774
|
7791
|
7795