[GRADLE-3018] The same enum values as task inputs are considered different Created: 10/Feb/14 Updated: 08/Aug/16 Resolved: 25/Jul/16 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 3.0-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Michael Barnathan (Inactive) |
Resolution: | Fixed | Votes: | 3 |
Issue Links: |
|
Description |
New Gradle Forums Topic: https://discuss.gradle.org/t/two-different-instances-of-the-same-enum-value-for-previous-and-current-input-property-when-using-the-gradle-daemon/1162 The equals() implementation for Enum values is based on object identity. This is problematic when the values of two different instances of the same enum class are tested for equality. This can happen in Gradle when using enum classes from a 3rd party (i.e. non core) and the daemon because of the task artifact cache being held in memory across builds. |
Comments |
Comment by René Gröschke (Inactive) [ 16/Mar/16 ] |
handling of enums in non daemon environment needs further investigation. |
Comment by Eric Wendelin [ 07/Jul/16 ] |
Additional context: At least one root problem we're encountering here is that Gradle will create a new ClassLoader when a build script is changed and we currently cannot compare non-primitive values that aren't files because Objects from different ClassLoaders cannot be equal. One very slow solution would be to serialize both Enum values. According to my testing with the example project and tests defined in InMemoryTaskArtifactsIntegrationTest, this is not a daemon-specific issue. |