Giter Site home page Giter Site logo

Support null values about icepick HOT 6 CLOSED

frankiesardo avatar frankiesardo commented on July 23, 2024
Support null values

from icepick.

Comments (6)

frankiesardo avatar frankiesardo commented on July 23, 2024

That's not an error that happens with every object.
It specifically happens for boxed primitives (e.g. Integer, Long..) which are not automatically initialised like their unboxed counterparts (int, long). Thanks for reporting the bug, I believe icepick should work around it rather than fail with NPE, but I strongly advise all users to either avoid using boxed primitives or give a default value when the variable is initialised.

from icepick.

MFlisar avatar MFlisar commented on July 23, 2024

Even if you advise not to use null values, the possibility to use them is always useful (and I personally have usecases where I don't want a default value for an object but rather a null value).

To avoid the unnecessary null check, it could be possible to use two annotations, one for objects that are never null and one for objects that can be null (like "@icicle" and "@IcicleNullable" or so)

Please tell me if you think this is something useful and if you plan to implement it. I've never worked with annotation processors, but I would look into it and extend the library with an extra annotation otherwise... Although, I probably need longer than you would :-)

from icepick.

Alexander-- avatar Alexander-- commented on July 23, 2024

I have created a merge request which adds sort of support for this. Feel free to comment on the implementation there.

from icepick.

clemp6r avatar clemp6r commented on July 23, 2024

Any update?

from icepick.

frankiesardo avatar frankiesardo commented on July 23, 2024

If @Alexander-- is not interested anymore in his PR, I will fix it on the fly myself. Expect a snapshot version soon(ish).

from icepick.

frankiesardo avatar frankiesardo commented on July 23, 2024

Pushed a 2.3.7-SNAPSHOT artefact. It should just work now.

from icepick.

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.