On Sun, 12 Aug 2001 21:06, Jeff Turner wrote: > A question, mainly for Pete, > > Enum and ValuedEnum both have public constructors: > > public Enum( final String name ); > public Enum( final String name, final Map map ); > public ValuedEnum( final String name, final int value ); > public ValuedEnum( final String name, final int value, final Map map ); > > Because they're public, any class can add more Enum items at any time, > so the Enum is not type-safe at all. Possibly a security hazard if > anyone was relying on subclasses' type-safety. > > Since the only time they should ever be called is within a subclass, > would it be better to make them protected? This technically breaks > backwards-compatibility, but only where the class is being incorrectly > used.
It used to be protected at one stage ... can't seem to recall why it was made public. Is there any code in Avalon that it would break? Cheers, Pete *-----------------------------------------------------* | "Faced with the choice between changing one's mind, | | and proving that there is no need to do so - almost | | everyone gets busy on the proof." | | - John Kenneth Galbraith | *-----------------------------------------------------* --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
