diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt index 481dd409798fb8..c9f8789a9fb71b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt @@ -21,7 +21,7 @@ package com.facebook.react.common.mapbuffer * Limitations: * - Keys are usually sized as 2 bytes, with each buffer supporting up to 65536 entries as a result. * - O(log(N)) random key access for native buffers due to selected structure. Faster access can be - * achieved by retrieving [MapBuffer.Entry] with [entryAt] on known offsets. + * achieved by retrieving [MapBuffer.Entry] with [entryAt] on known offsets. */ interface MapBuffer : Iterable { companion object { @@ -46,12 +46,14 @@ interface MapBuffer : Iterable { /** * Number of elements inserted into current MapBuffer. + * * @return number of elements in the [MapBuffer] */ val count: Int /** * Checks whether entry for given key exists in MapBuffer. + * * @param key key to lookup the entry * @return whether entry for the given key exists in the MapBuffer. */ @@ -60,6 +62,7 @@ interface MapBuffer : Iterable { /** * Provides offset of the key to use for [entryAt], for cases when offset is not statically known * but can be cached. + * * @param key key to lookup offset for * @return offset for the given key to be used for entry access, -1 if key wasn't found. */ @@ -67,14 +70,16 @@ interface MapBuffer : Iterable { /** * Provides parsed access to a MapBuffer without additional lookups for provided offset. + * * @param offset offset of entry in the MapBuffer structure. Can be looked up for known keys with - * [getKeyOffset]. + * [getKeyOffset]. * @return parsed entry for structured access for given offset */ fun entryAt(offset: Int): MapBuffer.Entry /** * Provides parsed [DataType] annotation associated with the given key. + * * @param key key to lookup type for * @return data type of the given key. * @throws IllegalArgumentException if the key doesn't exist @@ -83,6 +88,7 @@ interface MapBuffer : Iterable { /** * Provides parsed [Boolean] value if the entry for given key exists with [DataType.BOOL] type + * * @param key key to lookup [Boolean] value for * @return value associated with the requested key * @throws IllegalArgumentException if the key doesn't exist @@ -92,6 +98,7 @@ interface MapBuffer : Iterable { /** * Provides parsed [Int] value if the entry for given key exists with [DataType.INT] type + * * @param key key to lookup [Int] value for * @return value associated with the requested key * @throws IllegalArgumentException if the key doesn't exist @@ -101,6 +108,7 @@ interface MapBuffer : Iterable { /** * Provides parsed [Double] value if the entry for given key exists with [DataType.DOUBLE] type + * * @param key key to lookup [Double] value for * @return value associated with the requested key * @throws IllegalArgumentException if the key doesn't exist @@ -110,6 +118,7 @@ interface MapBuffer : Iterable { /** * Provides parsed [String] value if the entry for given key exists with [DataType.STRING] type + * * @param key key to lookup [String] value for * @return value associated with the requested key * @throws IllegalArgumentException if the key doesn't exist @@ -119,6 +128,7 @@ interface MapBuffer : Iterable { /** * Provides parsed [MapBuffer] value if the entry for given key exists with [DataType.MAP] type + * * @param key key to lookup [MapBuffer] value for * @return value associated with the requested key * @throws IllegalArgumentException if the key doesn't exist @@ -129,6 +139,7 @@ interface MapBuffer : Iterable { /** * Provides parsed [List] value if the entry for given key exists with [DataType.MAP] * type + * * @param key key to lookup [List] value for * @return value associated with the requested key * @throws IllegalArgumentException if the key doesn't exist @@ -149,30 +160,35 @@ interface MapBuffer : Iterable { /** * Entry value represented as [Boolean] + * * @throws IllegalStateException if the data type doesn't match [DataType.BOOL] */ val booleanValue: Boolean /** * Entry value represented as [Int] + * * @throws IllegalStateException if the data type doesn't match [DataType.INT] */ val intValue: Int /** * Entry value represented as [Double] + * * @throws IllegalStateException if the data type doesn't match [DataType.DOUBLE] */ val doubleValue: Double /** * Entry value represented as [String] + * * @throws IllegalStateException if the data type doesn't match [DataType.STRING] */ val stringValue: String /** * Entry value represented as [MapBuffer] + * * @throws IllegalStateException if the data type doesn't match [DataType.MAP] */ val mapBufferValue: MapBuffer diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt index 744a9ee15a55a5..ccfc730773427b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt @@ -66,7 +66,7 @@ class ReadableMapBuffer : MapBuffer { /** * @param key Key to search for * @return the "bucket index" for a key or -1 if not found. It uses a binary search algorithm - * (log(n)) + * (log(n)) */ private fun getBucketIndexForKey(intKey: Int): Int { if (intKey !in KEY_RANGE) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt index bb27c26c1ef09f..8a6a7a9b9bb6a7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt @@ -30,6 +30,7 @@ class WritableMapBuffer : MapBuffer { /** * Adds a boolean value for given key to the MapBuffer. + * * @param key entry key * @param value entry value * @throws IllegalArgumentException if key is out of [UShort] range @@ -38,6 +39,7 @@ class WritableMapBuffer : MapBuffer { /** * Adds an int value for given key to the MapBuffer. + * * @param key entry key * @param value entry value * @throws IllegalArgumentException if key is out of [UShort] range @@ -46,6 +48,7 @@ class WritableMapBuffer : MapBuffer { /** * Adds a double value for given key to the MapBuffer. + * * @param key entry key * @param value entry value * @throws IllegalArgumentException if key is out of [UShort] range @@ -54,6 +57,7 @@ class WritableMapBuffer : MapBuffer { /** * Adds a string value for given key to the MapBuffer. + * * @param key entry key * @param value entry value * @throws IllegalArgumentException if key is out of [UShort] range @@ -62,6 +66,7 @@ class WritableMapBuffer : MapBuffer { /** * Adds a [MapBuffer] value for given key to the current MapBuffer. + * * @param key entry key * @param value entry value * @throws IllegalArgumentException if key is out of [UShort] range diff --git a/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt b/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt index 7189aa6fb49cda..25308ce96b9745 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt +++ b/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt @@ -20,7 +20,7 @@ import com.facebook.react.ReactRootView * * @param fabricEnabled Whether Fabric should be enabled for the RootView of this Activity. * @param concurrentRootEnabled Whether ConcurrentRoot (aka React 18) should be enabled for the - * RootView of this Activity. + * RootView of this Activity. */ open class DefaultReactActivityDelegate( activity: ReactActivity, diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt index 553bc175020944..d805dabe31c9c7 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt @@ -89,7 +89,7 @@ abstract class ReactExtension @Inject constructor(project: Project) { * will: * - Not be bundled (the bundle file will not be created and won't be copied over). * - Have the Hermes Debug flags set. That's useful if you have another variant (say `canary`) - * where you want dev mode to be enabled. Default: ['debug'] + * where you want dev mode to be enabled. Default: ['debug'] */ val debuggableVariants: ListProperty = objects.listProperty(String::class.java).convention(listOf("debug")) diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/utils/PrefabPreprocessingEntry.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/utils/PrefabPreprocessingEntry.kt index 943bba3eaaca25..522100150c4936 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/utils/PrefabPreprocessingEntry.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/utils/PrefabPreprocessingEntry.kt @@ -11,10 +11,11 @@ import java.io.Serializable /** * This data class represents an entry that can be consumed by the [PreparePrefabHeadersTask]. + * * @param libraryName The name of the library that you're preparing for Prefab * @param pathToPrefixCouples A list of pairs Path to Header prefix. You can use this list to supply - * a list of paths that you want to be considered for prefab. Each path can specify an header prefix - * that will be used by prefab to re-created the header layout. + * a list of paths that you want to be considered for prefab. Each path can specify an header + * prefix that will be used by prefab to re-created the header layout. */ data class PrefabPreprocessingEntry( val libraryName: String, diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt index a4239dd898e13a..552a611d5225c0 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt @@ -43,10 +43,10 @@ internal fun detectedCliFile(config: ReactExtension): File = * Computes the `hermesc` command location. The Algo follows this order: * 1. The path provided by the `hermesCommand` config in the `react` Gradle extension * 2. The file located in `node_modules/react-native/sdks/hermes/build/bin/hermesc`. This will be - * used if the user is building Hermes from source. + * used if the user is building Hermes from source. * 3. The file located in `node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc` where `%OS-BIN%` - * is substituted with the correct OS arch. This will be used if the user is using a precompiled - * hermes-engine package. + * is substituted with the correct OS arch. This will be used if the user is using a precompiled + * hermes-engine package. * 4. Fails otherwise */ internal fun detectedHermesCommand(config: ReactExtension): String = @@ -106,10 +106,10 @@ private fun detectCliFile(reactNativeRoot: File, preconfiguredCliFile: File?): F * Computes the `hermesc` command location. The Algo follows this order: * 1. The path provided by the `hermesCommand` config in the `react` Gradle extension * 2. The file located in `node_modules/react-native/sdks/hermes/build/bin/hermesc`. This will be - * used if the user is building Hermes from source. + * used if the user is building Hermes from source. * 3. The file located in `node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc` where `%OS-BIN%` - * is substituted with the correct OS arch. This will be used if the user is using a precompiled - * hermes-engine package. + * is substituted with the correct OS arch. This will be used if the user is using a precompiled + * hermes-engine package. * 4. Fails otherwise */ internal fun detectOSAwareHermesCommand(projectRoot: File, hermesCommand: String): String {