From a5c693dd53cd4b406a0de841cdb20dac104012e0 Mon Sep 17 00:00:00 2001 From: Krzysztof Magiera Date: Wed, 21 Oct 2015 09:02:21 -0700 Subject: [PATCH] Fix typo in ReadableMapKeySetIterator. Reviewed By: mkonicek Differential Revision: D2564934 fb-gh-sync-id: 2ef1a0f5c1550d912dc751100c307659a5159fa3 --- .../react/bridge/InvalidIteratorException.java | 2 +- .../java/com/facebook/react/bridge/ReadableMap.java | 2 +- ...yIterator.java => ReadableMapKeySetIterator.java} | 2 +- .../com/facebook/react/bridge/ReadableNativeMap.java | 10 +++++----- .../uimanager/NativeViewHierarchyOptimizer.java | 4 ++-- .../facebook/react/uimanager/ReactShadowNode.java | 4 ++-- .../com/facebook/react/uimanager/ViewManager.java | 4 ++-- ReactAndroid/src/main/jni/react/jni/OnLoad.cpp | 12 ++++++------ 8 files changed, 20 insertions(+), 20 deletions(-) rename ReactAndroid/src/main/java/com/facebook/react/bridge/{ReadableMapKeySeyIterator.java => ReadableMapKeySetIterator.java} (92%) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/InvalidIteratorException.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/InvalidIteratorException.java index eea4c1d07..2e5261b7f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/InvalidIteratorException.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/InvalidIteratorException.java @@ -12,7 +12,7 @@ package com.facebook.react.bridge; import com.facebook.proguard.annotations.DoNotStrip; /** - * Exception thrown by {@link ReadableMapKeySeyIterator#nextKey()} when the iterator tries + * Exception thrown by {@link ReadableMapKeySetIterator#nextKey()} when the iterator tries * to iterate over elements after the end of the key set. */ @DoNotStrip diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMap.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMap.java index 5aa5adb43..b9e83f2d9 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMap.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMap.java @@ -24,5 +24,5 @@ public interface ReadableMap { ReadableArray getArray(String name); ReadableMap getMap(String name); ReadableType getType(String name); - ReadableMapKeySeyIterator keySetIterator(); + ReadableMapKeySetIterator keySetIterator(); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMapKeySeyIterator.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMapKeySetIterator.java similarity index 92% rename from ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMapKeySeyIterator.java rename to ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMapKeySetIterator.java index 3218611d3..9710496b6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMapKeySeyIterator.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMapKeySetIterator.java @@ -15,7 +15,7 @@ import com.facebook.proguard.annotations.DoNotStrip; * Interface of a iterator for a {@link NativeMap}'s key set. */ @DoNotStrip -public interface ReadableMapKeySeyIterator { +public interface ReadableMapKeySetIterator { boolean hasNextKey(); String nextKey(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java index ac1eabbb1..07545e703 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java @@ -44,20 +44,20 @@ public class ReadableNativeMap extends NativeMap implements ReadableMap { public native ReadableType getType(String name); @Override - public ReadableMapKeySeyIterator keySetIterator() { - return new ReadableNativeMapKeySeyIterator(this); + public ReadableMapKeySetIterator keySetIterator() { + return new ReadableNativeMapKeySetIterator(this); } /** * Implementation of a {@link ReadableNativeMap} iterator in native memory. */ @DoNotStrip - private static class ReadableNativeMapKeySeyIterator extends Countable - implements ReadableMapKeySeyIterator { + private static class ReadableNativeMapKeySetIterator extends Countable + implements ReadableMapKeySetIterator { private final ReadableNativeMap mReadableNativeMap; - public ReadableNativeMapKeySeyIterator(ReadableNativeMap readableNativeMap) { + public ReadableNativeMapKeySetIterator(ReadableNativeMap readableNativeMap) { mReadableNativeMap = readableNativeMap; initialize(mReadableNativeMap); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java index 03c53ca8b..d8ec7ae92 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java @@ -14,7 +14,7 @@ import javax.annotation.Nullable; import android.util.SparseBooleanArray; import com.facebook.infer.annotation.Assertions; -import com.facebook.react.bridge.ReadableMapKeySeyIterator; +import com.facebook.react.bridge.ReadableMapKeySetIterator; /** * Class responsible for optimizing the native view hierarchy while still respecting the final UI @@ -417,7 +417,7 @@ public class NativeViewHierarchyOptimizer { return false; } - ReadableMapKeySeyIterator keyIterator = props.mBackingMap.keySetIterator(); + ReadableMapKeySetIterator keyIterator = props.mBackingMap.keySetIterator(); while (keyIterator.hasNextKey()) { if (!ViewProps.isLayoutOnly(keyIterator.nextKey())) { return false; diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java index 78a1d57af..9443d98ff 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java @@ -17,7 +17,7 @@ import java.util.Map; import com.facebook.csslayout.CSSNode; import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.bridge.ReadableMapKeySeyIterator; +import com.facebook.react.bridge.ReadableMapKeySetIterator; /** * Base node class for representing virtual tree of React nodes. Shadow nodes are used primarily @@ -166,7 +166,7 @@ public class ReactShadowNode extends CSSNode { Map propSetters = ViewManagersPropertyCache.getNativePropSettersForShadowNodeClass(getClass()); ReadableMap propMap = props.mBackingMap; - ReadableMapKeySeyIterator iterator = propMap.keySetIterator(); + ReadableMapKeySetIterator iterator = propMap.keySetIterator(); while (iterator.hasNextKey()) { String key = iterator.nextKey(); ViewManagersPropertyCache.PropSetter setter = propSetters.get(key); diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java index 726c5f765..ca128e987 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java @@ -19,7 +19,7 @@ import android.view.View; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.bridge.ReadableMapKeySeyIterator; +import com.facebook.react.bridge.ReadableMapKeySetIterator; import com.facebook.react.touch.CatalystInterceptingViewGroup; import com.facebook.react.touch.JSResponderHandler; @@ -36,7 +36,7 @@ public abstract class ViewManager { Map propSetters = ViewManagersPropertyCache.getNativePropSettersForViewManagerClass(getClass()); ReadableMap propMap = props.mBackingMap; - ReadableMapKeySeyIterator iterator = propMap.keySetIterator(); + ReadableMapKeySetIterator iterator = propMap.keySetIterator(); // TODO(krzysztof): Remove missingSetters code once all views are migrated to @ReactProp boolean missingSetters = false; while (iterator.hasNextKey()) { diff --git a/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp b/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp index 813fb382a..e34cba0db 100644 --- a/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +++ b/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp @@ -50,11 +50,11 @@ struct NativeMap : public Countable { folly::dynamic map = folly::dynamic::object; }; -struct ReadableNativeMapKeySeyIterator : public Countable { +struct ReadableNativeMapKeySetIterator : public Countable { folly::dynamic::const_item_iterator iterator; RefPtr mapRef; - ReadableNativeMapKeySeyIterator(folly::dynamic::const_item_iterator&& it, + ReadableNativeMapKeySetIterator(folly::dynamic::const_item_iterator&& it, const RefPtr& mapRef_) : iterator(std::move(it)) , mapRef(mapRef_) {} @@ -490,19 +490,19 @@ namespace iterator { static void initialize(JNIEnv* env, jobject obj, jobject nativeMapObj) { auto nativeMap = extractRefPtr(env, nativeMapObj); - auto mapIterator = createNew( + auto mapIterator = createNew( nativeMap->map.items().begin(), nativeMap); setCountableForJava(env, obj, std::move(mapIterator)); } static jboolean hasNextKey(JNIEnv* env, jobject obj) { - auto nativeIterator = extractRefPtr(env, obj); + auto nativeIterator = extractRefPtr(env, obj); return ((nativeIterator->iterator != nativeIterator->mapRef.get()->map.items().end()) ? JNI_TRUE : JNI_FALSE); } static jstring getNextKey(JNIEnv* env, jobject obj) { - auto nativeIterator = extractRefPtr(env, obj); + auto nativeIterator = extractRefPtr(env, obj); if (JNI_FALSE == hasNextKey(env, obj)) { throwNewJavaException("com/facebook/react/bridge/InvalidIteratorException", "No such element exists"); @@ -792,7 +792,7 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { map::writable::mergeMap) }); - registerNatives("com/facebook/react/bridge/ReadableNativeMap$ReadableNativeMapKeySeyIterator", { + registerNatives("com/facebook/react/bridge/ReadableNativeMap$ReadableNativeMapKeySetIterator", { makeNativeMethod("initialize", "(Lcom/facebook/react/bridge/ReadableNativeMap;)V", map::iterator::initialize), makeNativeMethod("hasNextKey", map::iterator::hasNextKey),