Open Tomas-Kraus opened 14 years ago
@glassfishrobot Commented Reported by mbz
@glassfishrobot Commented pkotlov said: Same here. Since i normally use @XmlElement(name="x-y") it really breaks my schema.
@glassfishrobot Commented Was assigned to yaroska
@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-755
The following code snippet fails to marshal as expected. If @XmlElement is removed anything works like a charm.
class Order { private HashMap<Integer, Integer> oi;
public Order() {} public Order(HashMap<Integer, Integer> oi)
{ this.oi = oi;}
@XmlElement public void setOi(HashMap<Integer, Integer> oi)
{ this.oi = oi; }
public HashMap<Integer, Integer> getOi()
{ return this.oi; }
public static void main(String[] args)
{ JAXBContext context = JAXBContext.newInstance(Order.class); Marshaller marshaller = context.createMarshaller(); HashMap<Integer, Integer> oi = new HashMap<Integer, Integer>(); oi.put(1,1); oi.put(2,2); Order order = new Order(oi); marshaller.marshal(order, new PrintWriter(System.out)); }
}
Environment
Operating System: All Platform: All
Affected Versions
[2.2]