This message was deleted.
# develocity
s
This message was deleted.
c
have something conceptually similar - a ValueSource that pulled in an repository authentication token (via SSO, etc) and not wanting the CC to be invalidated when the token changed. To accomplish that, used a wrapper object as the type of the ValueSource that omitted the token from the equals & hashcode (other fields that should force a CC change remained in equals/hashcode).
Copy code
public class CodeArtifactToken(public val url: String, public val value: String) : Serializable {
    /*
     * Only compare on URL to prevent ValueSource from dirtying configuration cache when token value changes
     */
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as CodeArtifactToken

        if (url != other.url) return false

        return true
    }

    /*
     * Only use URL to prevent ValueSource from dirtying configuration cache when token value changes
     */
    override fun hashCode(): Int {
        return url.hashCode()
    }
}
e
Interesting approach, thanks!