Q about geom implementation

Sven de Marothy sven@physto.se
Mon Nov 22 15:05:00 GMT 2004


>I notice that several methods such as RectangularShape.getBounds2D
>are missing according to the comparison of gcj with jdk. I can see
>that they get implemented by the concrete implementations of classes
>such as Rectangle2D.Double.

I belive geom to be 100% ok.
This is a bug in JAPI. RectangularShape is abstract and is not required
to overload getBounds2D (nor does it, see API docs.) 
An abstract class can be declared to implement an interface without
including implementations of all methods. The non-implemented methods
are just considered abstract as well.
>However, if a client program were to derive a class from
>RectangularShape, it could break due to the absence of this method. 

A class extending RectangularShape must implement getBounds2D on its
own, since RectangularShape does not and should not. It shouldn't
compile otherwise, since the class then fails to implement the interface
Shape.
/Sven


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /