Skip to content

Commit 3cfd4cb

Browse files
ASCE1885Morgan Pretty
authored andcommitted
fix mTimerIdsToTimers remove error
Summary: In Timing.java, the key provided to the remove function of mTimerIdsToTimers is not correct, that may introduce bugs. Closes facebook#8966 Differential Revision: D3605291 Pulled By: astreet fbshipit-source-id: 97563b6846e8f3f40d20b48b3852dd557c9932f3
1 parent 39de246 commit 3cfd4cb

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

ReactAndroid/src/main/java/com/facebook/react/modules/core/Timing.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.facebook.react.bridge.ReactMethod;
2323
import com.facebook.react.bridge.UiThreadUtil;
2424
import com.facebook.react.bridge.WritableArray;
25-
import com.facebook.react.common.MapBuilder;
2625
import com.facebook.react.common.SystemClock;
2726
import com.facebook.react.devsupport.DevSupportManager;
2827
import com.facebook.react.uimanager.ReactChoreographer;
@@ -105,7 +104,7 @@ public void doFrame(long frameTimeNanos) {
105104
timer.mTargetTime = frameTimeMillis + timer.mInterval;
106105
mTimers.add(timer);
107106
} else {
108-
mTimerIdsToTimers.remove(timer.mCallbackID);
107+
mTimerIdsToTimers.remove(timer.mExecutorToken);
109108
}
110109
}
111110
}
@@ -386,7 +385,7 @@ public void deleteTimer(ExecutorToken executorToken, int timerId) {
386385
return;
387386
}
388387
// We may have already called/removed it
389-
mTimerIdsToTimers.remove(timerId);
388+
mTimerIdsToTimers.remove(executorToken);
390389
mTimers.remove(timer);
391390
}
392391
}

ReactAndroid/src/main/java/com/facebook/react/views/art/ARTRenderableViewManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ public String getName() {
5252

5353
@Override
5454
public ReactShadowNode createShadowNodeInstance() {
55-
if (mClassName == CLASS_GROUP) {
55+
if (CLASS_GROUP.equals(mClassName)) {
5656
return new ARTGroupShadowNode();
57-
} else if (mClassName == CLASS_SHAPE) {
57+
} else if (CLASS_SHAPE.equals(mClassName)) {
5858
return new ARTShapeShadowNode();
59-
} else if (mClassName == CLASS_TEXT) {
59+
} else if (CLASS_TEXT.equals(mClassName)) {
6060
return new ARTTextShadowNode();
6161
} else {
6262
throw new IllegalStateException("Unexpected type " + mClassName);
@@ -65,11 +65,11 @@ public ReactShadowNode createShadowNodeInstance() {
6565

6666
@Override
6767
public Class<? extends ReactShadowNode> getShadowNodeClass() {
68-
if (mClassName == CLASS_GROUP) {
68+
if (CLASS_GROUP.equals(mClassName)) {
6969
return ARTGroupShadowNode.class;
70-
} else if (mClassName == CLASS_SHAPE) {
70+
} else if (CLASS_SHAPE.equals(mClassName)) {
7171
return ARTShapeShadowNode.class;
72-
} else if (mClassName == CLASS_TEXT) {
72+
} else if (CLASS_TEXT.equals(mClassName)) {
7373
return ARTTextShadowNode.class;
7474
} else {
7575
throw new IllegalStateException("Unexpected type " + mClassName);

0 commit comments

Comments
 (0)