Hey John :)

Would you take a look at this patch for the 1.6 branch, r4184? It
removes all the "throws" declarations from the Event.get* methods,
both in the method signatures and the javadoc, because we don't
actually do those assertions anymore.

M      user/src/com/google/gwt/user/client/Event.java

Thanks!

-- 
Alex Rudnick
swe, gwt, atl

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Index: user/src/com/google/gwt/user/client/Event.java
===================================================================
--- user/src/com/google/gwt/user/client/Event.java	(revision 4184)
+++ user/src/com/google/gwt/user/client/Event.java	(working copy)
@@ -283,12 +283,8 @@
    * Gets whether the ALT key was depressed when the given event occurred.
    * 
    * @return <code>true</code> if ALT was depressed when the event occurred
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#MOUSEEVENTS}, [EMAIL PROTECTED] Event#ONCLICK},
-   *           [EMAIL PROTECTED] Event#ONDBLCLICK}, [EMAIL PROTECTED] Event#KEYEVENTS}, or
-   *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final boolean getAltKey() throws AssertionError {
+  public final boolean getAltKey() {
     return DOM.eventGetAltKey(this);
   }
 
@@ -297,10 +293,8 @@
    * 
    * @return a bit-field, defined by [EMAIL PROTECTED] Event#BUTTON_LEFT},
    *         [EMAIL PROTECTED] Event#BUTTON_MIDDLE}, and [EMAIL PROTECTED] Event#BUTTON_RIGHT}
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#ONMOUSEDOWN} or [EMAIL PROTECTED] Event#ONMOUSEUP}
    */
-  public final int getButton() throws AssertionError {
+  public final int getButton() {
     return DOM.eventGetButton(this);
   }
 
@@ -308,12 +302,8 @@
    * Gets the mouse x-position within the browser window's client area.
    * 
    * @return the mouse x-position
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#MOUSEEVENTS}, [EMAIL PROTECTED] Event#ONCLICK},
-   *           [EMAIL PROTECTED] Event#ONDBLCLICK}, [EMAIL PROTECTED] Event#ONMOUSEWHEEL}, or
-   *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final int getClientX() throws AssertionError {
+  public final int getClientX() {
     return DOM.eventGetClientX(this);
   }
 
@@ -321,12 +311,8 @@
    * Gets the mouse y-position within the browser window's client area.
    * 
    * @return the mouse y-position
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#MOUSEEVENTS}, [EMAIL PROTECTED] Event#ONCLICK},
-   *           [EMAIL PROTECTED] Event#ONDBLCLICK}, [EMAIL PROTECTED] Event#ONMOUSEWHEEL}, or
-   *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final int getClientY() throws AssertionError {
+  public final int getClientY() {
     return DOM.eventGetClientY(this);
   }
 
@@ -334,12 +320,8 @@
    * Gets whether the CTRL key was depressed when the given event occurred.
    * 
    * @return <code>true</code> if CTRL was depressed when the event occurred
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#MOUSEEVENTS}, [EMAIL PROTECTED] Event#ONCLICK},
-   *           [EMAIL PROTECTED] Event#ONDBLCLICK}, [EMAIL PROTECTED] Event#KEYEVENTS}, or
-   *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final boolean getCtrlKey() throws AssertionError {
+  public final boolean getCtrlKey() {
     return DOM.eventGetCtrlKey(this);
   }
 
@@ -358,10 +340,8 @@
    * [EMAIL PROTECTED] Event#ONMOUSEOVER}).
    * 
    * @return the element from which the mouse pointer was moved
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#ONMOUSEOVER} or [EMAIL PROTECTED] Event#ONMOUSEOUT}
    */
-  public final Element getFromElement() throws AssertionError {
+  public final Element getFromElement() {
     return DOM.eventGetFromElement(this);
   }
 
@@ -375,10 +355,9 @@
    * </p>
    * 
    * @return the Unicode character or key code.
-   * @throws AssertionError if event type is not one of [EMAIL PROTECTED] Event#KEYEVENTS}
    * @see com.google.gwt.user.client.ui.KeyboardListener
    */
-  public final int getKeyCode() throws AssertionError {
+  public final int getKeyCode() {
     return DOM.eventGetKeyCode(this);
   }
 
@@ -386,12 +365,8 @@
    * Gets whether the META key was depressed when the given event occurred.
    * 
    * @return <code>true</code> if META was depressed when the event occurred
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#MOUSEEVENTS}, [EMAIL PROTECTED] Event#ONCLICK},
-   *           [EMAIL PROTECTED] Event#ONDBLCLICK}, [EMAIL PROTECTED] Event#KEYEVENTS}, or
-   *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final boolean getMetaKey() throws AssertionError {
+  public final boolean getMetaKey() {
     return DOM.eventGetMetaKey(this);
   }
 
@@ -408,9 +383,8 @@
    * </p>
    * 
    * @return The velocity of the mouse wheel.
-   * @throws AssertionError if event type is not [EMAIL PROTECTED] Event#ONMOUSEWHEEL}
    */
-  public final int getMouseWheelVelocityY() throws AssertionError {
+  public final int getMouseWheelVelocityY() {
     return DOM.eventGetMouseWheelVelocityY(this);
   }
 
@@ -418,9 +392,8 @@
    * Gets the key-repeat state of this event.
    * 
    * @return <code>true</code> if this key event was an auto-repeat
-   * @throws AssertionError if event type is not [EMAIL PROTECTED] Event#ONKEYDOWN}
    */
-  public final boolean getRepeat() throws AssertionError {
+  public final boolean getRepeat() {
     return DOM.eventGetRepeat(this);
   }
 
@@ -433,7 +406,7 @@
    *           [EMAIL PROTECTED] Event#ONCLICK}, [EMAIL PROTECTED] Event#ONDBLCLICK}, or
    *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final int getScreenX() throws AssertionError {
+  public final int getScreenX() {
     return DOM.eventGetScreenX(this);
   }
 
@@ -441,12 +414,8 @@
    * Gets the mouse y-position on the user's display.
    * 
    * @return the mouse y-position
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#MOUSEEVENTS}, [EMAIL PROTECTED] Event#ONMOUSEWHEEL},
-   *           [EMAIL PROTECTED] Event#ONCLICK}, [EMAIL PROTECTED] Event#ONDBLCLICK}, or
-   *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final int getScreenY() throws AssertionError {
+  public final int getScreenY() {
     return DOM.eventGetScreenY(this);
   }
 
@@ -454,12 +423,8 @@
    * Gets whether the shift key was depressed when the given event occurred.
    * 
    * @return <code>true</code> if shift was depressed when the event occurred
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#MOUSEEVENTS}, [EMAIL PROTECTED] Event#ONCLICK},
-   *           [EMAIL PROTECTED] Event#ONDBLCLICK}, [EMAIL PROTECTED] Event#KEYEVENTS}, or
-   *           [EMAIL PROTECTED] Event#ONCONTEXTMENU}
    */
-  public final boolean getShiftKey() throws AssertionError {
+  public final boolean getShiftKey() {
     return DOM.eventGetShiftKey(this);
   }
 
@@ -489,10 +454,8 @@
    * [EMAIL PROTECTED] Event#ONMOUSEOUT}).
    * 
    * @return the element to which the mouse pointer was moved
-   * @throws AssertionError if event type is not one of
-   *           [EMAIL PROTECTED] Event#ONMOUSEOVER} or [EMAIL PROTECTED] Event#ONMOUSEOUT}
    */
-  public final Element getToElement() throws AssertionError {
+  public final Element getToElement() {
     return DOM.eventGetToElement(this);
   }
 

Reply via email to