0 Replies Latest reply: Oct 8, 2009 9:01 AM by 843807 RSS

    Can someone provide a reference in the JavaBean spec that says ...

    843807
      Can someone provide a reference in the JavaBean spec that says overloaded setters are contrary to the spec?

      In this example I have two setters that differ only in their single param type.
      Is this illegal and if so then where is this documented?

      class AmIALegalJavaBean {
           void setData(String);
           void setData(byte[]);
      }

      Is it actually undocumented as an illegal construct, and therefore permitted by default?

      ---

      The JavaBean spec seems to permit explicitely one for of overloading ...
      Section 8.3.3 relates to 'indexed property's

      Class IAmStillAJavaBean {
      public Bah[] getFoo(); // simple property
      public void setFoo(Bah a[]); // simple property
      public Bah getFoo(int a); // indexed variant
      public void setFoo(int a, Bah b); // indexed variant
      }

      What if anything else does the documentation say about overloading in JavaBeans?