> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Stuart Ballard
>
> John Keiser wrote:
> >
> > Can you show one example of a protected class in the
> documentation? I think
> > that would settle this for good. Paul asserted that there were
> no protected
> > classes in JavaDoc and concluded based on that that Sun didn't
> intend for
> > protected classes to be part of the public API.
> >
> > --John Keiser
>
> java.io.Reader and Writer have protected fields with objects to
> synchronize on. I *think* that java.util.Vector has a protected Object[]
> field containing its elements. java.util.AbstractList in 1.2RC1 has a
> protected removeRange method. I know there are many more, but I can't
> think of them off the top of my head.
>
> I'm not sure about protected classes, because you can't have a protected
> top-level class and as far as I know I've never seen a protected inner
> class at all, but the same logic follows for classes as for fields and
> methods.
>
I agree there.
ClassLoader has protected members which every single ClassLoader
implementation out there today depends on. So in short, protected members
are part of the public API. Since inner classes have roughly the same
access rules as other class members, it makes sense that this blanket be
applied to protected inner classes. protected inner classes should be a
part of the public API.
Not that it matters a whole heck of a lot right now, since as far as we know
there are no protected inner classes in the 1.2 API. It would be best to
fix the script, though.
--John Keiser