Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin query beans are not getting enhanced correctly after IntelliJ Rebuild #2083

Open
bkempe opened this issue Oct 15, 2020 · 4 comments
Open

Comments

@bkempe
Copy link

bkempe commented Oct 15, 2020

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)
@jnehlmeier
Copy link

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.

@bkempe
Copy link
Author

bkempe commented Feb 12, 2021

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

@rvowles
Copy link
Contributor

rvowles commented Aug 7, 2021

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.

@bkempe
Copy link
Author

bkempe commented Aug 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants