Commit 49e58846 by Anthony Green Committed by Anthony Green

AbstractGraphicsState.java (clone): Handle CloneNotSupportedException.

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
parent 8ec88074
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
......
......@@ -128,6 +128,14 @@ public abstract class AbstractGraphicsState implements Cloneable
public Object clone ()
{
try
{
return super.clone ();
}
catch (CloneNotSupportedException ex)
{
// This should never happen.
throw new InternalError ();
}
}
}
......@@ -105,6 +105,8 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
public Object clone()
{
try
{
Graphics2DImpl gfxCopy = (Graphics2DImpl) super.clone();
AbstractGraphicsState stateCopy =
(AbstractGraphicsState) state.clone();
......@@ -112,6 +114,12 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
return gfxCopy;
}
catch (CloneNotSupportedException ex)
{
// This should never happen.
throw new InternalError ();
}
}
// -------- Graphics methods:
......
......@@ -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);
}
}
/** get next event. Will block until events become available. */
......
......@@ -46,11 +46,19 @@ public class XGraphics implements Cloneable, DirectRasterGraphics
public Object clone()
{
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()
{
......
......@@ -154,19 +154,11 @@ 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;
}
}
}
}
......
......@@ -36,6 +36,8 @@ public class GC implements Cloneable
*/
public Object clone()
{
try
{
GC gcClone = target.getGCFromCache ();
if (gcClone==null)
{
......@@ -46,6 +48,12 @@ public class GC implements Cloneable
gcClone.updateClip();
return gcClone;
}
catch (CloneNotSupportedException ex)
{
// This should never happen.
throw new InternalError ();
}
}
private native void initStructure(GC copyFrom);
......
......@@ -27,6 +27,8 @@ public class WMSizeHints implements Cloneable
protected native void finalize();
public Object clone() {
try
{
WMSizeHints hints = (WMSizeHints) super.clone();
// In case of an exception before the stucture is copied.
hints.structure = null;
......@@ -34,6 +36,12 @@ public class WMSizeHints implements Cloneable
hints.init(this);
return hints;
}
catch (CloneNotSupportedException ex)
{
// This should never happen.
throw new InternalError ();
}
}
public native void applyNormalHints(Window window);
......
......@@ -43,6 +43,8 @@ public class WindowAttributes
public Object clone()
{
try
{
WindowAttributes attributes = (WindowAttributes) super.clone();
// In case of an exception before the stucture is copied.
attributes.in = null;
......@@ -53,6 +55,12 @@ public class WindowAttributes
attributes.init(this);
return attributes;
}
catch (CloneNotSupportedException ex)
{
// This should never happen.
throw new InternalError ();
}
}
public native void setBackground(long pixel);
public native void setBackground(Pixmap pixmap);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment