Git Product home page Git Product logo

Comments (10)

johncarl81 avatar johncarl81 commented on August 10, 2024

Here's the relevant discussion: #21. Please share a different argument/perspective if you like.

TLDR: You can make your field either transient or @Transient to avoid serialization and the associated warning.

from parceler.

jacobtabak avatar jacobtabak commented on August 10, 2024

Thanks, that's what I've done - and sorry for not seeing the other issue. Just seemed like strange default behavior.

from parceler.

johncarl81 avatar johncarl81 commented on August 10, 2024

It's more than ok.. yeah, I agree it's strange behavior. I'm still open to changing it of course.

from parceler.

jacobtabak avatar jacobtabak commented on August 10, 2024

I'm reopening this because the warning is incorrect and "strange" - I have a public static final variable, yet the warning says I should make it non-private.

from parceler.

johncarl81 avatar johncarl81 commented on August 10, 2024

So the question is: Do we ignore static fields, final fields or the combination static final? If we do ignore, then should we turn these on by annotating by @ParcelProperty?

from parceler.

jacobtabak avatar jacobtabak commented on August 10, 2024

I think the current implementation has consistency in its favor.

Here are my thoughts on each case:

static (including static final) should not be parcelled unless annotated and not trigger a warning, I think this is enough of an edge case that if you want to parcel it you should come to the page and read the documentation. I believe this because static variables are more indicative of application state, not object state. And the idea is to parcel the object, not the application state.

final should trigger a warning - but the warning should be consistent with the declared field, specifically, in my case, it should not suggest that I make it non-private when it's already non-private.

from parceler.

johncarl81 avatar johncarl81 commented on August 10, 2024

Ah, I didn't notice the language. Here's the relevant fix to the warning: johncarl81/transfuse@87b4ebe

from parceler.

jacobtabak avatar jacobtabak commented on August 10, 2024

Thanks, and after thinking some more, I think just disabling the warnings for static fields would be good enough.

from parceler.

johncarl81 avatar johncarl81 commented on August 10, 2024

Currently I don't think static fields generate warnings... Only if they are private or final would they trigger a warning.

from parceler.

johncarl81 avatar johncarl81 commented on August 10, 2024

I'm going to close this issue. Please reopen if you have more.

from parceler.

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.