]> gcc.gnu.org Git - gcc.git/commitdiff
AbstractGraphicsState.java (clone): Handle CloneNotSupportedException.
authorAnthony Green <green@redhat.com>
Mon, 21 Jul 2003 02:24:09 +0000 (02:24 +0000)
committerAnthony Green <green@gcc.gnu.org>
Mon, 21 Jul 2003 02:24:09 +0000 (02:24 +0000)
2003-07-20  Anthony Green  <green@redhat.com>

* gnu/awt/j2d/AbstractGraphicsState.java (clone): Handle
CloneNotSupportedException.
* gnu/gcj/xlib/WindowAttributes.java (clone): Ditto.
* gnu/gcj/xlib/WMSizeHints.java (clone): Ditto.
* gnu/gcj/xlib/GC.java (clone): Ditto.
* gnu/awt/xlib/XGraphics.java (clone): Ditto.
* gnu/awt/j2d/Graphics2DImpl.java (clone): Ditto.

* gnu/awt/xlib/XEventLoop.java (postNextEvent): Remove unreachable
handler.
* gnu/gcj/runtime/NameFinder.java (NameFinder): Ditto.

From-SVN: r69623

libjava/ChangeLog
libjava/gnu/awt/j2d/AbstractGraphicsState.java
libjava/gnu/awt/j2d/Graphics2DImpl.java
libjava/gnu/awt/xlib/XEventLoop.java
libjava/gnu/awt/xlib/XGraphics.java
libjava/gnu/gcj/runtime/NameFinder.java
libjava/gnu/gcj/xlib/GC.java
libjava/gnu/gcj/xlib/WMSizeHints.java
libjava/gnu/gcj/xlib/WindowAttributes.java

index 8bc4dc79a56e6900e5d6e4f02d2db5b6da8a2168..6e2c4922de61b7ef063009138126b86061cccae6 100644 (file)
@@ -1,3 +1,17 @@
+2003-07-20  Anthony Green  <green@redhat.com>
+
+       * gnu/awt/j2d/AbstractGraphicsState.java (clone): Handle
+       CloneNotSupportedException.
+       * gnu/gcj/xlib/WindowAttributes.java (clone): Ditto.
+       * gnu/gcj/xlib/WMSizeHints.java (clone): Ditto.
+       * gnu/gcj/xlib/GC.java (clone): Ditto.
+       * gnu/awt/xlib/XGraphics.java (clone): Ditto.
+       * gnu/awt/j2d/Graphics2DImpl.java (clone): Ditto.
+
+       * gnu/awt/xlib/XEventLoop.java (postNextEvent): Remove unreachable
+       handler.
+       * gnu/gcj/runtime/NameFinder.java (NameFinder): Ditto.
+
 2003-07-20  Steve Pribyl <steve@netfuel.com.>
 
        * gnu/gcj/runtime/natSharedLibLoader.cc (init): `libname' now a
index 1c29bc202f6cd5a1d50824262b507812906e59b4..038bc9c6c7d985539f4276985c629de677da372d 100644 (file)
@@ -128,6 +128,14 @@ public abstract class AbstractGraphicsState implements Cloneable
 
   public Object clone ()
   {
-    return super.clone ();
+    try
+      {
+       return super.clone ();
+      }
+    catch (CloneNotSupportedException ex)
+      {
+       // This should never happen.
+       throw new InternalError ();
+      }
   }
 }
index e5daa9dec6bd8c4a9e1a3e2e6a148114b10f19c1..dd46e7fe410f3e9e178eec4f6da713cfe43ef5e9 100644 (file)
@@ -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 ();
+      }
   }
 
 
index 4d2932089397d86dcdd4ade37110489f4a37d7f8..ad5e963437a107f4ff4c6a69b242d174e9a14c05 100644 (file)
@@ -48,17 +48,8 @@ public class XEventLoop implements Runnable
 
   void postNextEvent()
   {
-    try
-      {
-       AWTEvent evt = getNextEvent();
-       queue.postEvent(evt);
-       
-      }
-    catch (InterruptedException ie)
-      {
-       // FIXME: what now?
-       System.err.println(ie);
-      }
+    AWTEvent evt = getNextEvent();
+    queue.postEvent(evt);
   }
     
   /** get next event. Will block until events become available. */
index 9f29fa5b94a4a69e8073d1135735c887ee2849e1..b8614023377d0428156717430dc92ed6e56f4ab5 100644 (file)
@@ -46,10 +46,18 @@ public class XGraphics implements Cloneable, DirectRasterGraphics
 
   public Object clone()
   {
-    XGraphics gfxCopy = (XGraphics) super.clone();
-    gfxCopy.context = context.create();
-    
-    return gfxCopy;
+    try
+      {
+       XGraphics gfxCopy = (XGraphics) super.clone();
+       gfxCopy.context = context.create();
+       
+       return gfxCopy;
+      }
+    catch (CloneNotSupportedException ex)
+      {
+       // This should never happen.
+       throw new InternalError ();
+      }
   }
 
   public void dispose()
index 19820c1bd6bb28e9284440ae498a42805d0bba9a..0c3583683900bfca22266c01051f6273e09e7b88 100644 (file)
@@ -154,18 +154,10 @@ public class NameFinder
 
        if (addr2line != null)
          {
-           try
-             {
-               addr2lineIn = new BufferedReader
-                       (new InputStreamReader(addr2line.getInputStream()));
-               addr2lineOut = new BufferedWriter
-                       (new OutputStreamWriter(addr2line.getOutputStream()));
-             }
-           catch (IOException ioe)
-             {  
-               addr2line.destroy();
-               addr2line = null;
-             }
+           addr2lineIn = new BufferedReader
+             (new InputStreamReader(addr2line.getInputStream()));
+           addr2lineOut = new BufferedWriter
+             (new OutputStreamWriter(addr2line.getOutputStream()));
          }
       }
   }
index 021f53756fbbed06efc33adf8f505cf1672007ed..b7eb0b682f4d210ed336527352ba5b6d2dcb7c1d 100644 (file)
@@ -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);
index 29344eee1ebe6d0b2bd398911fe92b86ba21668a..c0b198c58a704ae453079a9c169a3b8c12978252 100644 (file)
@@ -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);
index 6efeaa5d4346e1faa49eb08062aab0de85db0383..23be37d6363ae47f48a2f42edf980b87603f13ce 100644 (file)
@@ -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);
This page took 0.080719 seconds and 5 git commands to generate.