src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java

Print this page

        

@@ -416,11 +416,12 @@
      * invoking {@link java.awt.EventQueue#getMostRecentEventTime()}.
      */
     private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
         s.defaultReadObject();
         if (when == 0) {
-            when = getMostRecentEventTimeForSource(this.source);
+            // Can't use getMostRecentEventTimeForSource because source is always null during deserialization
+            when = EventQueue.getMostRecentEventTime();
         }
     }
 
     /**
      * Get the most recent event time in the {@code EventQueue} which the {@code source}