This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: RoundRectangle2D


Tom Tromey wrote:

> Have you seen a recent collections regression?  I can't compile
> TreeMap right now -- but I could last week.

Well, I don't actually have TreeMap in my build yet, but I'll look into
it.

> Bryce> There is an argument that using the accessors is more correct
> Bryce> in case somebody overrides them, but if override setX(), for
> Bryce> example, then you really need to call super.setX() as well in
> Bryce> order to do anything useful.
>
> Thia makes sense to me.  Thanks.  I agree that we should just use the
> fields directly.  In some cases, though, this will mean moving methods
> into subclasses (eg Rectangle2D doesn't have any fields -- they are
> always in subclasses).

Oh, you're right, I forgot that Rectangle2D is abstract. I really meant
for classes like Rectangle2D.Double where we currently have:

    public void setRect (Rectangle2D r)
    {
      this.x = r.getX ();
      this.y = r.getY ();

The methods in RectangularShape etc are just meant to be slow fallbacks
to make it easier for people to create subclasses, just like the
Abstract* classes in the collections framework. All the concrete
implementations should provide faster implementations which reference the
fields directly (note how the fields in these classes are actually public
in order to make accessible from other packages).

> The geom.*2D stuff bugs me.  It is a poor excuse for parameterized
> types.  Doing it by hand means extra maintenance burden for us.
> Bleah.

Yeah. Bummer.

regards

  [ bryce ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]