1. #1
    Ext GWT Premium Member
    Join Date
    Jul 2008
    Posts
    33
    Vote Rating
    0
    Adam Ward is on a distinguished road

      0  

    Default [FIXED] [1.2.3] Dispatcher forwardEvent throws NPE

    [FIXED] [1.2.3] Dispatcher forwardEvent throws NPE


    This is a very simple bug that can be seen by simply looking at the following static methods in the Dispatcher class:
    Code:
    /**
       * Forwards an app event to the dispatcher.
       * 
       * @param event the app event
       */
      public static void forwardEvent(AppEvent event) {
        instance.dispatch(event);
      }
    
      /**
       * Creates and forwards an app event to the dispatcher.
       * 
       * @param eventType the app event type
       */
      public static void forwardEvent(int eventType) {
        instance.dispatch(eventType);
      }
    
      /**
       * Creates and fowards an app event to the dispatcher.
       * 
       * @param eventType the app event type
       * @param data the event data
       */
      public static void forwardEvent(int eventType, Object data) {
        instance.dispatch(new AppEvent(eventType, data));
      }
    
      /**
       * Creates and fowards an app event to the dispatcher.
       * 
       * @param eventType the app event type
       * @param data the event data
       * @param historyEvent true to mark event as a history event
       */
      public static void forwardEvent(int eventType, Object data, boolean historyEvent) {
        AppEvent ae = new AppEvent(eventType, data);
        ae.historyEvent = historyEvent;
        instance.dispatch(ae);
      }
    Not one of these methods checks to see if the instance variable is null. forwardEvent is a very handy shorthand method for getting the instance and dispatching an event, but you must call Dispatcher.get() before hand to initialize the singleton instance, which doesn't make sense to me.

    To reproduce this bug, simply insert the following line at the very top of the onModuleLoad method in any application:
    Code:
    Dispatcher.forwardEvent(1);
    Note: the value 1, can be substituted with any AppEvent or integer that maps to a specific AppEvent in your application.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Fixed in SVN.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar