From 900fed576b3f459e606222d276f841b5001d5d8b Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 24 May 2021 13:39:36 -0700 Subject: [PATCH] Events: Remove default `getCoalescingKey` impls Summary: Event.java's default implementation of `getCoalescingKey` returns 0. Most overrides of getCoalescingKey just return 0. Delete them. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D28650792 fbshipit-source-id: 374591fb4ba2305df934de412790b3397ca2fa1c --- .../react/views/drawer/events/DrawerClosedEvent.java | 6 ------ .../react/views/drawer/events/DrawerOpenedEvent.java | 6 ------ .../react/views/drawer/events/DrawerSlideEvent.java | 6 ------ .../react/views/drawer/events/DrawerStateChangedEvent.java | 6 ------ .../java/com/facebook/react/views/scroll/ScrollEvent.java | 6 ------ .../com/facebook/react/views/slider/ReactSliderEvent.java | 5 ----- .../react/views/slider/ReactSlidingCompleteEvent.java | 5 ----- .../facebook/react/views/switchview/ReactSwitchEvent.java | 6 ------ 8 files changed, 46 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.java index 06be4490ab2b9f..29c724c1ada911 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.java @@ -33,10 +33,4 @@ public String getEventName() { protected WritableMap getEventData() { return Arguments.createMap(); } - - @Override - public short getCoalescingKey() { - // All events for a given view can be coalesced. - return 0; - } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.java index 35adbe6b71b403..d1402f593cecef 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.java @@ -33,10 +33,4 @@ public String getEventName() { protected WritableMap getEventData() { return Arguments.createMap(); } - - @Override - public short getCoalescingKey() { - // All events for a given view can be coalesced. - return 0; - } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.java index d8dda5c560a532..57f2ef5fa60ac1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.java @@ -37,12 +37,6 @@ public String getEventName() { return EVENT_NAME; } - @Override - public short getCoalescingKey() { - // All slide events for a given view can be coalesced. - return 0; - } - @Override protected WritableMap getEventData() { WritableMap eventData = Arguments.createMap(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.java index abdb8a38a76d2d..6a9f8e9fb06d01 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.java @@ -36,12 +36,6 @@ public String getEventName() { return EVENT_NAME; } - @Override - public short getCoalescingKey() { - // All events for a given view can be coalesced. - return 0; - } - @Override protected WritableMap getEventData() { WritableMap eventData = Arguments.createMap(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java index 9d4ba87d9b147c..5b0c0c312be4b0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java @@ -124,12 +124,6 @@ public String getEventName() { return ScrollEventType.getJSEventName(Assertions.assertNotNull(mScrollEventType)); } - @Override - public short getCoalescingKey() { - // All scroll events for a given view can be coalesced - return 0; - } - @Override public boolean canCoalesce() { // Only SCROLL events can be coalesced, all others can not be diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderEvent.java index 09f764ddb3753d..5b5c85f85925fd 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderEvent.java @@ -39,11 +39,6 @@ public String getEventName() { return EVENT_NAME; } - @Override - public short getCoalescingKey() { - return 0; - } - @Override public void dispatch(RCTEventEmitter rctEventEmitter) { rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData()); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSlidingCompleteEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSlidingCompleteEvent.java index 075fd7b46e8a37..44832295f071c0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSlidingCompleteEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSlidingCompleteEvent.java @@ -47,11 +47,6 @@ protected WritableMap getEventData() { return eventData; } - @Override - public short getCoalescingKey() { - return 0; - } - @Override public boolean canCoalesce() { return false; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchEvent.java index 38d0a76c91e210..70f44a0354674b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchEvent.java @@ -46,10 +46,4 @@ protected WritableMap getEventData() { eventData.putBoolean("value", getIsChecked()); return eventData; } - - @Override - public short getCoalescingKey() { - // All switch events for a given view can be coalesced. - return 0; - } }