Code is incorrect and will not compile, says my IDE

Prev

The bug

Your favorite IDE, such as IntelliJ or Eclipse or VS Code, says that the code generated by Poja is ill-formed and thus will not compile.

For example, if you activate the File Storage capabilities of Poja, it will generate the BucketComponent class that allows you to upload and download files to/from a cloud bucket.

Here, the attribute bucketConf is marked final. Yet it is not initialized in any constructor in the source code. Hence, your IDE yells at you and says it will not compile.

The solution

Poja uses Lombok to reduce boilerplate code. For example, the @AllArgsConstructor annotation mentioned in above code snippet asks Lombok to generate a constructor that initializes all final arguments of the BucketComponent class.

Now the subtleties is that Lombok generates its code during compilation. This means, the source code is incorrect with respect to the plain Java syntax, and will only become correct once Lombok finished generating its part at compile time.

In order to tell your IDE to not worry about that incorrectness, as it will be fixed later at compile time, you have to install the Lombok plugin:

The Lombok website offers support for various IDE if yours is not listed above.