> I am writing some classes that comply with java bean contract soI must
> supply default constructor.
> But *my* code should never call this constructor. Is it possible to make
> the compiler warn me if I inadvertantly call it?
You could put a "@deprecated" javadoc comment in front of it. For example:
/**
* Default constructor.
* @deprecated Do not use it!
*/
public MyBean() {
}

Signature
"TFritsch$t-online:de".replace(':','.').replace('$','@')
VisionSet - 19 Nov 2005 20:53 GMT
> > I am writing some classes that comply with java bean contract soI must
> > supply default constructor.
> > But *my* code should never call this constructor. Is it possible to make
> > the compiler warn me if I inadvertantly call it?
> You could put a "@deprecated" javadoc comment in front of it. For example:
I wonder if any automatic use of beans would object to that?
Not that it will affect my case - just passing to JSP pages, and they don't
write beans.
--
Mike W
Roedy Green - 19 Nov 2005 21:36 GMT
On Sat, 19 Nov 2005 21:31:48 +0100, "Thomas Fritsch"
<i.dont.like.spam@invalid.com> wrote, quoted or indirectly quoted
someone who said :
>> I am writing some classes that comply with java bean contract soI must
>> supply default constructor.
>> But *my* code should never call this constructor. Is it possible to make
>> the compiler warn me if I inadvertantly call it?
Are you allowed to make it private? I guess beans need it for their
own XML-based serialization scheme.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.