diff --git a/bundler/src/main/java/com/skydoves/bundler/ActivityBundleLazy.kt b/bundler/src/main/java/com/skydoves/bundler/ActivityBundleLazy.kt index 551806a..c40ceb6 100644 --- a/bundler/src/main/java/com/skydoves/bundler/ActivityBundleLazy.kt +++ b/bundler/src/main/java/com/skydoves/bundler/ActivityBundleLazy.kt @@ -34,7 +34,7 @@ import java.io.Serializable @JvmSynthetic @InlineBundleDsl inline fun Activity.bundle(key: String, defaultValue: T): Lazy { - return lazy { + return lazy(LazyThreadSafetyMode.NONE) { when (defaultValue) { is Boolean -> intent.getBooleanExtra(key, defaultValue) is Byte -> intent.getByteExtra(key, defaultValue) @@ -68,7 +68,7 @@ inline fun Activity.bundle( crossinline defaultValue: () -> T? = { null } ): Lazy { val objectType = T::class.javaObjectType - return lazy { + return lazy(LazyThreadSafetyMode.NONE) { @Suppress("UNCHECKED_CAST") when { // references @@ -113,7 +113,7 @@ inline fun Activity.bundleArray( crossinline defaultValue: () -> Array? = { null } ): Lazy?> { val javaObjectType = T::class.javaObjectType - return lazy { + return lazy(LazyThreadSafetyMode.NONE) { @Suppress("UNCHECKED_CAST") when { String::class.java.isAssignableFrom(javaObjectType) -> intent.getStringArrayExtra(key) @@ -140,7 +140,7 @@ inline fun Activity.bundleArrayList( crossinline defaultValue: () -> ArrayList? = { null } ): Lazy?> { val javaObjectType = T::class.javaObjectType - return lazy { + return lazy(LazyThreadSafetyMode.NONE) { @Suppress("UNCHECKED_CAST") when { String::class.java.isAssignableFrom(javaObjectType) -> intent.getStringArrayListExtra(key) diff --git a/bundler/src/main/java/com/skydoves/bundler/FragmentBundleLazy.kt b/bundler/src/main/java/com/skydoves/bundler/FragmentBundleLazy.kt index f735907..8b6f0bb 100644 --- a/bundler/src/main/java/com/skydoves/bundler/FragmentBundleLazy.kt +++ b/bundler/src/main/java/com/skydoves/bundler/FragmentBundleLazy.kt @@ -34,7 +34,7 @@ import java.io.Serializable @JvmSynthetic @InlineBundleDsl fun Fragment.bundle(key: String, defaultValue: T): Lazy = - lazy { + lazy(LazyThreadSafetyMode.NONE) { when (defaultValue) { is Boolean -> arguments?.getBoolean(key, defaultValue) is Byte -> arguments?.getByte(key, defaultValue) @@ -67,7 +67,7 @@ inline fun Fragment.bundle( crossinline defaultValue: () -> T? = { null } ): Lazy { val objectType = T::class.javaObjectType - return lazy { + return lazy(LazyThreadSafetyMode.NONE) { @Suppress("UNCHECKED_CAST") when { // references @@ -108,7 +108,7 @@ inline fun Fragment.bundleArray( crossinline defaultValue: () -> Array? = { null } ): Lazy?> { val javaObjectType = T::class.javaObjectType - return lazy { + return lazy(LazyThreadSafetyMode.NONE) { @Suppress("UNCHECKED_CAST") when { String::class.java.isAssignableFrom(javaObjectType) -> arguments?.getStringArray(key) @@ -135,7 +135,7 @@ inline fun Fragment.bundleArrayList( crossinline defaultValue: () -> ArrayList? = { null } ): Lazy?> { val javaObjectType = T::class.javaObjectType - return lazy { + return lazy(LazyThreadSafetyMode.NONE) { @Suppress("UNCHECKED_CAST") when { String::class.java.isAssignableFrom(javaObjectType) -> arguments?.getStringArrayList(key)