Giter Site home page Giter Site logo

Comments (6)

cpovirk avatar cpovirk commented on June 14, 2024 2

Thanks for the report and the fix.

As for @NullMarked and @NullUnmarked: My read is that Lombok's lists are for copying annotations from fields only. If so, then we wouldn't have reason to list those annotations, as they aren't applicable to fields (only to methods/classes/packages/modules).

from nullaway.

kjim avatar kjim commented on June 14, 2024 1

Thanks for the info. I tried your suggestion on https://github.com/kjim/nullaway-example/pull/1/files and the issue has been gone.

In my case, simply adding the following one settings seems to solve the problem (since I don’t use @NonNull).

lombok.copyableAnnotations+=org.jspecify.annotations.Nullable

This workaround seems to work well. Until jspecify annotation is added (or changed?) on lombok side, I can proceed with the migration by adding this setting. Thanks!

from nullaway.

msridhar avatar msridhar commented on June 14, 2024 1

I opened a PR to fix this upstream in Lombok: projectlombok/lombok#3613

from nullaway.

msridhar avatar msridhar commented on June 14, 2024 1

Fixed upstream in projectlombok/lombok#3608

from nullaway.

msridhar avatar msridhar commented on June 14, 2024

Thanks for this report! This is not intentional behavior; it's quite surprising in fact. Let me dig a bit to see if I can fix.

from nullaway.

msridhar avatar msridhar commented on June 14, 2024

Based on projectlombok/lombok#3346 I figured out the right config required here:

lombok.copyableAnnotations+=org.jspecify.annotations.NonNull
lombok.copyableAnnotations+=org.jspecify.annotations.Nullable

If you want Lombok to use JSpecify annotations for generated code you can also do:

lombok.addNullAnnotations = CUSTOM:TYPE_USE:org.jspecify.annotations.NonNull:org.jspecify.annotations.Nullable

To avoid needing any extra config, I think these two lines in Lombok need to be updated to use the latest JSpecify package names and to refer to @NonNull instead of @NullnessUnspecified:

https://github.com/projectlombok/lombok/blob/8bea25107de8177596546574c02ed204366e1281/src/core/lombok/core/handlers/HandlerUtil.java#L188-L189

(@cpovirk should @NullMarked / @NullUnmarked be in that list as well?)

In any case, let me know if the above config works for you. I'll leave this issue open until we can open an appropriate PR / issue on Lombok.

from nullaway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.