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 https://github.com/facebook/react-native/pull/8966

Differential Revision: D3605291

Pulled By: astreet

fbshipit-source-id: 97563b6846e8f3f40d20b48b3852dd557c9932f3
This commit is contained in:
ASCE1885 2016-07-22 09:16:50 -07:00 committed by Facebook Github Bot 8
parent 235c059605
commit 37e5f3b6ca
2 changed files with 8 additions and 9 deletions

View File

@ -22,7 +22,6 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.common.MapBuilder;
import com.facebook.react.common.SystemClock;
import com.facebook.react.devsupport.DevSupportManager;
import com.facebook.react.uimanager.ReactChoreographer;
@ -105,7 +104,7 @@ public final class Timing extends ReactContextBaseJavaModule implements Lifecycl
timer.mTargetTime = frameTimeMillis + timer.mInterval;
mTimers.add(timer);
} else {
mTimerIdsToTimers.remove(timer.mCallbackID);
mTimerIdsToTimers.remove(timer.mExecutorToken);
}
}
}
@ -386,7 +385,7 @@ public final class Timing extends ReactContextBaseJavaModule implements Lifecycl
return;
}
// We may have already called/removed it
mTimerIdsToTimers.remove(timerId);
mTimerIdsToTimers.remove(executorToken);
mTimers.remove(timer);
}
}

View File

@ -52,11 +52,11 @@ public class ARTRenderableViewManager extends ViewManager<View, ReactShadowNode>
@Override
public ReactShadowNode createShadowNodeInstance() {
if (mClassName == CLASS_GROUP) {
if (CLASS_GROUP.equals(mClassName)) {
return new ARTGroupShadowNode();
} else if (mClassName == CLASS_SHAPE) {
} else if (CLASS_SHAPE.equals(mClassName)) {
return new ARTShapeShadowNode();
} else if (mClassName == CLASS_TEXT) {
} else if (CLASS_TEXT.equals(mClassName)) {
return new ARTTextShadowNode();
} else {
throw new IllegalStateException("Unexpected type " + mClassName);
@ -65,11 +65,11 @@ public class ARTRenderableViewManager extends ViewManager<View, ReactShadowNode>
@Override
public Class<? extends ReactShadowNode> getShadowNodeClass() {
if (mClassName == CLASS_GROUP) {
if (CLASS_GROUP.equals(mClassName)) {
return ARTGroupShadowNode.class;
} else if (mClassName == CLASS_SHAPE) {
} else if (CLASS_SHAPE.equals(mClassName)) {
return ARTShapeShadowNode.class;
} else if (mClassName == CLASS_TEXT) {
} else if (CLASS_TEXT.equals(mClassName)) {
return ARTTextShadowNode.class;
} else {
throw new IllegalStateException("Unexpected type " + mClassName);