ebean-orm / ebean-orm/ebean

Kotlin query beans are not getting enhanced correctly after IntelliJ Rebuild

Open
#2,083 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.5k
Forks
267
Avg merge
3d 20h
Merged PRs (30d)
5

Description

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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in the example-kotlin project by rebuilding in IntelliJ and running org.example.domain.CustomerTest with the ebean agent. Inspect QCustomer.kt at line 62 and CustomerTest.kt at line 28, then verify that CustomerTest.exampleAliasUse runs without the lateinit contacts exception after an IntelliJ rebuild.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
backend, build-system, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.