aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/awt/j2d/Graphics2DImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/gnu/awt/j2d/Graphics2DImpl.java')
-rw-r--r--libjava/gnu/awt/j2d/Graphics2DImpl.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java
index e5daa9dec6b..dd46e7fe410 100644
--- a/libjava/gnu/awt/j2d/Graphics2DImpl.java
+++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java
@@ -105,12 +105,20 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
public Object clone()
{
- Graphics2DImpl gfxCopy = (Graphics2DImpl) super.clone();
- AbstractGraphicsState stateCopy =
- (AbstractGraphicsState) state.clone();
- gfxCopy.setState(stateCopy);
-
- return gfxCopy;
+ try
+ {
+ Graphics2DImpl gfxCopy = (Graphics2DImpl) super.clone();
+ AbstractGraphicsState stateCopy =
+ (AbstractGraphicsState) state.clone();
+ gfxCopy.setState(stateCopy);
+
+ return gfxCopy;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}