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

Configuration inheritance fails on rebuild with JDK 19 #3

Open
marriesvdh opened this issue May 5, 2023 · 3 comments
Open

Configuration inheritance fails on rebuild with JDK 19 #3

marriesvdh opened this issue May 5, 2023 · 3 comments

Comments

@marriesvdh
Copy link

Issue:

The initial build works fine. However after changing a beanknife config class (adding a space is enough) and building again, two problems occur:

  1. For the edited config class, the inherited annotations are ignored in the build.
  2. The generated Meta class only contains the edited class.

Problem 1 occurs when building with JDK 19.0.2, but not with JDK 1.8.0_42
Problem 2 occurs with both SDKs

Steps to reproduce:

  • See https://github.com/marriesvdh/beanknife-inheritance-bug for a sample project
  • Build the project
    • The BeanView and BeanView2 classes are generated correctly (@ViewSetters(Access.PUBLIC) is inherited correctly, so BeanView contains a setter)
    • BeanMeta contains a reference to both views
  • Touch BeanViewConfig by adding a space
  • Build the project again (without clean)
    • The setter is not present anymore in the generated BeanView class.
    • The generated BeanMeta class only contains a reference to BeanView (and not BeanView2)

(After performing mvn clean, the first build is correct again)

Temporary workaround?

I assume the problem lies in the incremental compilation feature of Beanknife. Is it possible to disable this feature and rebuild all Beanknife classes everytime? As a temporary fix.

For now, cleaning before each build solves the issue.

@vipcxj
Copy link
Owner

vipcxj commented May 6, 2023

I have tested on jdk17, I can't reproduce the issue. I will try on jdk19 later.

@vipcxj
Copy link
Owner

vipcxj commented May 6, 2023

I have tested it on openjdk 19.0.2, I still can't reproduce the issue. Which ide are you used. I check it using IDEA

@marriesvdh
Copy link
Author

Thanks for looking into this!

I'm using Intellij IDEA Ultimate 2023.1.1 (newest). When building outside of the IDE (using the maven wrapper in the sample project), it works! When configuring Intellij to use maven for building (setting: Delegate IDE build/run actions to Maven), it also works.

So apparently the issue only occurs with the Intellij (incremental) builder. Maybe this is an Intellij bug then, what do you think?

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

2 participants