https://jsr311.dev.java.net/issues/show_bug.cgi?id=39:
"While they share a number of attributes, Cookie and NewCookie serve
different purposes. It might be cleaner if NewCookie contained a
Cookie rather than inheriting from it."
From Stephan:
"Issue 39: if NewCookie should not subclass Cookie for design reasons,
then NewCookie could contain the same 5 attributes and it's getter. I
see no advantage that NewCookie has a Cookie as attribute. Another
possibility is a common subclass with the attributes of Cookie, or a
common interface. The first reduces the lines of code, and both allows
to handle a NewCookie and a Cookie together, if someone needs it. For
equals(.) a NewCookie must never be equal to a Cookie, also if all
values are the same, because noth classes have a little bit different
semantics. Perhaps we could add an equal method If there is a common
abstract class, their could be a method AbstractCookie.equals(Cookie,
boolean), which boolean parameter allows to indicate, if a Cookie
could be equal to a NewCookie or not."
I'm tempted to close this one with no action (i.e. leave it as
NewCookie extends Cookie) - anyone have a strong opinion to the
contrary ?
Marc.
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.