[jboss-dev-forums] [Design of JBossXB] - Duplicate attributes

adrian@jboss.org do-not-reply at jboss.com
Thu Mar 6 14:04:32 EST 2008


I just found an interesting case that we should probably validate and fail.


  | public class BaseClass
  | {
  |    @XmlAttribute(name="something");
  |    public void setSomething(String value) {}
  | }
  | 
  | public class MyClass extends BaseClass
  | {
  |    @XmlAttribute(name="something")
  |    public void setSomethingElse(String value) {}
  | }
  | 

I gues which one gets used depends upon the order they appear
in the properties retriefved from BeanInfo?
But this should really be an error. You should have to do:


  | public class MyClass extends BaseClass
  | {
  |    @XmlTransient
  |    public void setSomething(String value) { super.setSomething(value); }
  | 
  |    @XmlAttribute(name="something")
  |    public void setSomethingElse(String value) {}
  | }
  | 

The same issue probably exists for properties on the same class
and elements as well?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134656#4134656

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134656



More information about the jboss-dev-forums mailing list