ebean icon indicating copy to clipboard operation
ebean copied to clipboard

Kotlin query beans are not getting enhanced correctly after IntelliJ Rebuild

Open bkempe opened this issue 5 years ago • 4 comments

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-kotlin into IntelliJ
  • Build > Rebuild Project
  • Run org.example.domain.CustomerTest with 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)

bkempe avatar Oct 15 '20 21:10 bkempe

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 avatar Feb 12 '21 09:02 jnehlmeier

@jnehlmeier Thx, updated. The issue happens with IntelliJ rebuilding using the internal rebuild, not via Maven.

bkempe avatar Feb 12 '21 12:02 bkempe

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.

rvowles avatar Aug 07 '21 00:08 rvowles

It appears this doesn't happen with Gradle, btw.

bkempe avatar Aug 07 '21 10:08 bkempe