Patch: super.clone() and CloneNotSupportedException

Tom Tromey tromey@redhat.com
Mon Jul 21 02:00:00 GMT 2003


>>>>> "Anthony" == Anthony Green <green@redhat.com> writes:

Anthony> 2003-07-19  Anthony Green  <green@redhat.com>
Anthony> 	* gnu/awt/j2d/AbstractGraphicsState.java (clone): Handle
Anthony> 	CloneNotSupportedException.
Anthony> 	* gnu/gcj/xlib/WindowAttributes.java (clone): Ditto.
Anthony> 	* gnu/gcj/xlib/WMSizeHints.java (clone): Ditto.
Anthony> 	* gnu/gcj/xlib/GC.java (clone): Ditto.
Anthony> 	* gnu/awt/xlib/XGraphics.java (clone): Ditto.
Anthony> 	* gnu/awt/j2d/Graphics2DImpl.java (clone): Ditto.

Ok, thanks.

Anthony> +    catch (CloneNotSupportedException ex)
Anthony> +      {
Anthony> +	// This should never happen.
Anthony> +	throw new InternalError ();
Anthony> +      }

In other places we've used "return null".  Yours is probably nicer.
It doesn't matter much, since this really, really is a "can't happen".
Something would have to be pretty broken for us to get to that branch.

Tom



More information about the Java-patches mailing list