Fix typo in ReadableMapKeySetIterator.
Reviewed By: mkonicek Differential Revision: D2564934 fb-gh-sync-id: 2ef1a0f5c1550d912dc751100c307659a5159fa3
This commit is contained in:
parent
852eba2a91
commit
a5c693dd53
|
@ -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
|
||||
|
|
|
@ -24,5 +24,5 @@ public interface ReadableMap {
|
|||
ReadableArray getArray(String name);
|
||||
ReadableMap getMap(String name);
|
||||
ReadableType getType(String name);
|
||||
ReadableMapKeySeyIterator keySetIterator();
|
||||
ReadableMapKeySetIterator keySetIterator();
|
||||
}
|
||||
|
|
|
@ -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();
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<String, ViewManagersPropertyCache.PropSetter> 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);
|
||||
|
|
|
@ -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<T extends View, C extends ReactShadowNode> {
|
|||
Map<String, ViewManagersPropertyCache.PropSetter> 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()) {
|
||||
|
|
|
@ -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<NativeMap> mapRef;
|
||||
|
||||
ReadableNativeMapKeySeyIterator(folly::dynamic::const_item_iterator&& it,
|
||||
ReadableNativeMapKeySetIterator(folly::dynamic::const_item_iterator&& it,
|
||||
const RefPtr<NativeMap>& 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<NativeMap>(env, nativeMapObj);
|
||||
auto mapIterator = createNew<ReadableNativeMapKeySeyIterator>(
|
||||
auto mapIterator = createNew<ReadableNativeMapKeySetIterator>(
|
||||
nativeMap->map.items().begin(), nativeMap);
|
||||
setCountableForJava(env, obj, std::move(mapIterator));
|
||||
}
|
||||
|
||||
static jboolean hasNextKey(JNIEnv* env, jobject obj) {
|
||||
auto nativeIterator = extractRefPtr<ReadableNativeMapKeySeyIterator>(env, obj);
|
||||
auto nativeIterator = extractRefPtr<ReadableNativeMapKeySetIterator>(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<ReadableNativeMapKeySeyIterator>(env, obj);
|
||||
auto nativeIterator = extractRefPtr<ReadableNativeMapKeySetIterator>(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),
|
||||
|
|
Loading…
Reference in New Issue