diff options
Diffstat (limited to 'libjava/gnu/gcj/xlib')
| -rw-r--r-- | libjava/gnu/gcj/xlib/GC.java | 26 | ||||
| -rw-r--r-- | libjava/gnu/gcj/xlib/WMSizeHints.java | 20 | ||||
| -rw-r--r-- | libjava/gnu/gcj/xlib/WindowAttributes.java | 24 |
3 files changed, 47 insertions, 23 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); diff --git a/libjava/gnu/gcj/xlib/WMSizeHints.java b/libjava/gnu/gcj/xlib/WMSizeHints.java index 29344eee1eb..c0b198c58a7 100644 --- a/libjava/gnu/gcj/xlib/WMSizeHints.java +++ b/libjava/gnu/gcj/xlib/WMSizeHints.java @@ -27,12 +27,20 @@ public class WMSizeHints implements Cloneable protected native void finalize(); public Object clone() { - WMSizeHints hints = (WMSizeHints) super.clone(); - // In case of an exception before the stucture is copied. - hints.structure = null; - - hints.init(this); - return hints; + try + { + WMSizeHints hints = (WMSizeHints) super.clone(); + // In case of an exception before the stucture is copied. + hints.structure = null; + + hints.init(this); + return hints; + } + catch (CloneNotSupportedException ex) + { + // This should never happen. + throw new InternalError (); + } } public native void applyNormalHints(Window window); diff --git a/libjava/gnu/gcj/xlib/WindowAttributes.java b/libjava/gnu/gcj/xlib/WindowAttributes.java index 6efeaa5d434..23be37d6363 100644 --- a/libjava/gnu/gcj/xlib/WindowAttributes.java +++ b/libjava/gnu/gcj/xlib/WindowAttributes.java @@ -43,15 +43,23 @@ public class WindowAttributes public Object clone() { - WindowAttributes attributes = (WindowAttributes) super.clone(); - // In case of an exception before the stucture is copied. - attributes.in = null; - attributes.out = null; - - // FIXME: do anything else? + try + { + WindowAttributes attributes = (WindowAttributes) super.clone(); + // In case of an exception before the stucture is copied. + attributes.in = null; + attributes.out = null; + + // FIXME: do anything else? - attributes.init(this); - return attributes; + attributes.init(this); + return attributes; + } + catch (CloneNotSupportedException ex) + { + // This should never happen. + throw new InternalError (); + } } public native void setBackground(long pixel); |

