Kotlin query beans are not getting enhanced correctly after IntelliJ Rebuild
Expected behavior
CustomerTest in https://github.com/ebean-orm-examples/example-kotlin runs without exception after an IntelliJ Rebuild.
Actual behavior
kotlin.UninitializedPropertyAccessException: lateinit property contacts has not been initialized
at org.example.domain.query.QCustomer.getContacts(QCustomer.kt:62)
at org.example.domain.CustomerTest.exampleAliasUse(CustomerTest.kt:28)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Steps to reproduce
- git clone https://github.com/ebean-orm-examples/example-kotlin
- mvn clean package
- import
example-kotlininto IntelliJ - Build > Rebuild Project
- Run
org.example.domain.CustomerTestwith VM Options-javaagent:ebean-agent-12.4.1.jar=debug=3(the same issue happens with the IntelliJ plugin)
Environment:
- IntelliJ IDEA 2020.2.3, IntelliJ IDEA 2020.3.2
- Settings -> Build -> Build Tools -> Maven -> Runner -> Delegate IDE build/run inactive
- Kotlin Plugin 1.4.10-release-IJ2020.2-1
- Java SDK OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
I think you should also mention if IntelliJ is configured to execute Build > Rebuild Project via Maven or not. See Settings -> Build -> Build Tools -> Maven -> Runner -> Delegate IDE build/run actions to Maven.
@jnehlmeier Thx, updated. The issue happens with IntelliJ rebuilding using the internal rebuild, not via Maven.
This is an IntellJ issue not an ebean issue, IntelliJ with kotlin is a bit of a mess, I'm using it actively and it isn't rebuilding standard kotlin classes.
It appears this doesn't happen with Gradle, btw.