Skip to content

Instantly share code, notes, and snippets.

@lptr
Created December 10, 2022 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lptr/bb4cfb2f31269a3211f3708532f99778 to your computer and use it in GitHub Desktop.
Save lptr/bb4cfb2f31269a3211f3708532f99778 to your computer and use it in GitHub Desktop.
diff --git a/subprojects/configuration-cache/src/main/kotlin/org/gradle/configurationcache/serialization/codecs/CalculatedValueContainerCodec.kt b/subprojects/configuration-cache/src/main/kotlin/org/gradle/configurationcache/serialization/codecs/CalculatedValueContainerCodec.kt
index afa4b27e8c6..037318b834c 100644
--- a/subprojects/configuration-cache/src/main/kotlin/org/gradle/configurationcache/serialization/codecs/CalculatedValueContainerCodec.kt
+++ b/subprojects/configuration-cache/src/main/kotlin/org/gradle/configurationcache/serialization/codecs/CalculatedValueContainerCodec.kt
@@ -33,7 +33,7 @@ class CalculatedValueContainerCodec(
) : Codec<CalculatedValueContainer<Any, ValueCalculator<Any>>> {
override suspend fun WriteContext.encode(value: CalculatedValueContainer<Any, ValueCalculator<Any>>) {
encodePreservingSharedIdentityOf(value) {
- val result = value.orNull
+ val result : Any? = value.orNull
if (result != null) {
writeBoolean(true)
write(result)
diff --git a/subprojects/core/src/main/java/org/gradle/internal/model/CalculatedValue.java b/subprojects/core/src/main/java/org/gradle/internal/model/CalculatedValue.java
index 841f87b2b47..1965cc37672 100644
--- a/subprojects/core/src/main/java/org/gradle/internal/model/CalculatedValue.java
+++ b/subprojects/core/src/main/java/org/gradle/internal/model/CalculatedValue.java
@@ -18,6 +18,7 @@
import org.gradle.internal.Try;
+import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;
/**
@@ -39,6 +40,7 @@
*
* <p>Rethrows any exception that happened while calculating the value</p>
*/
+ @Nullable
T getOrNull();
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment