classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: FYI: minor awt japi fix


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: minor awt japi fix
Date: 27 Sep 2005 12:19:43 -0600

I'm checking this in.

According to japi, these two methods should throw AWTException.  These
were documented correctly but the implementation incorrectly ignored
the possible AWTException.

Tom

2005-09-27  Tom Tromey  <address@hidden>

        * java/awt/Window.java (createBufferStrategy): Can throw AWTException.
        * java/awt/Canvas.java (createBufferStrategy): Can throw AWTException.

Index: java/awt/Canvas.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Canvas.java,v
retrieving revision 1.15
diff -u -r1.15 Canvas.java
--- java/awt/Canvas.java        2 Jul 2005 20:32:23 -0000       1.15
+++ java/awt/Canvas.java        27 Sep 2005 18:00:37 -0000
@@ -292,8 +292,8 @@
    *
    * @since 1.4
    */
-  public void createBufferStrategy(int numBuffers,
-                                  BufferCapabilities caps)
+  public void createBufferStrategy(int numBuffers, BufferCapabilities caps)
+    throws AWTException
   {
     if (numBuffers < 1)
       throw new IllegalArgumentException("Canvas.createBufferStrategy: number"
@@ -305,15 +305,7 @@
 
     // a flipping strategy was requested
     if (caps.isPageFlipping())
-      {
-       try
-         {
-           bufferStrategy = new CanvasFlipBufferStrategy(numBuffers);
-         }
-       catch (AWTException e)
-         {
-         }
-      }
+      bufferStrategy = new CanvasFlipBufferStrategy(numBuffers);
     else
       bufferStrategy = new CanvasBltBufferStrategy(numBuffers, true);
   }
Index: java/awt/Window.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v
retrieving revision 1.56
diff -u -r1.56 Window.java
--- java/awt/Window.java        20 Sep 2005 01:05:28 -0000      1.56
+++ java/awt/Window.java        27 Sep 2005 18:00:37 -0000
@@ -933,8 +933,8 @@
    *
    * @since 1.4
    */
-  public void createBufferStrategy(int numBuffers,
-                                  BufferCapabilities caps)
+  public void createBufferStrategy(int numBuffers, BufferCapabilities caps)
+    throws AWTException
   {
     if (numBuffers < 1)
       throw new IllegalArgumentException("Window.createBufferStrategy: number"
@@ -946,15 +946,7 @@
 
     // a flipping strategy was requested
     if (caps.isPageFlipping())
-      {
-       try
-         {
-           bufferStrategy = new WindowFlipBufferStrategy(numBuffers);
-         }
-       catch (AWTException e)
-         {
-         }
-      }
+      bufferStrategy = new WindowFlipBufferStrategy(numBuffers);
     else
       bufferStrategy = new WindowBltBufferStrategy(numBuffers, true);
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]