Closed
Description
There is flaky problem which leads to ArrayIndexOutOfBoundsException when dealing with Kotlin data classes with copy method having default values as entities in ClassGeneratingPropertyAccessorFactory.PropertyAccessorClassGenerator.generateCustomAccessorClass.
Please check this demo which reproduces the issue (just try to run ProblemDemoTests for several times and you'll receive ArrayIndexOutOfBoundsException): https://github.com/tano/aioob-demo/blob/master/src/test/kotlin/org/springframework/data/mapping/model/ProblemDemoTests.kt
Removing attempts: Int = this.attempts
default parameter solves the issues.
Version details:
Java: openjdk version "11.0.9.1" 2020-11-04 LTS
Kotlin: 1.4.30
spring-data-commons: 2.4.5