summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/gcj/xlib/GC.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/gnu/gcj/xlib/GC.java')
-rw-r--r--libjava/gnu/gcj/xlib/GC.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/libjava/gnu/gcj/xlib/GC.java b/libjava/gnu/gcj/xlib/GC.java
index 021f53756fb..b7eb0b682f4 100644
--- a/libjava/gnu/gcj/xlib/GC.java
+++ b/libjava/gnu/gcj/xlib/GC.java
@@ -36,15 +36,23 @@ public class GC implements Cloneable
*/
public Object clone()
{
- GC gcClone = target.getGCFromCache ();
- if (gcClone==null)
- {
- gcClone = (GC) super.clone();
- gcClone.structure = null;
- }
- gcClone.initStructure(this);
- gcClone.updateClip();
- return gcClone;
+ try
+ {
+ GC gcClone = target.getGCFromCache ();
+ if (gcClone==null)
+ {
+ gcClone = (GC) super.clone();
+ gcClone.structure = null;
+ }
+ gcClone.initStructure(this);
+ gcClone.updateClip();
+ return gcClone;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
private native void initStructure(GC copyFrom);
OpenPOWER on IntegriCloud