Comments (10)
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.
Thanks, that's what I've done - and sorry for not seeing the other issue. Just seemed like strange default behavior.
from parceler.
It's more than ok.. yeah, I agree it's strange behavior. I'm still open to changing it of course.
from parceler.
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.
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.
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.
Ah, I didn't notice the language. Here's the relevant fix to the warning: johncarl81/transfuse@87b4ebe
from parceler.
Thanks, and after thinking some more, I think just disabling the warnings for static fields would be good enough.
from parceler.
Currently I don't think static fields generate warnings... Only if they are private or final would they trigger a warning.
from parceler.
I'm going to close this issue. Please reopen if you have more.
from parceler.
Related Issues (20)
- Ability to treat reflection warnings as errors HOT 5
- Parceler fails when used with with Lifecycle-viewmodel 2.2.0 HOT 7
- Facing Vulnerabilities in parceler library HOT 1
- Facing Vulnerabilities in parceler library HOT 1
- Polymorphism documentation not updated? HOT 6
- Cannot get working with navigation graph HOT 1
- Crashing on background HOT 4
- ParcelAnnotationProcessor.process take lot amount of time. HOT 15
- Unable to find generated Parcelable class HOT 1
- error: Parceler: Code generation did not complete successfully. HOT 47
- Cant find class to parcel ! HOT 1
- Can't generate code HOT 3
- Unable to Marshall with Parceler HOT 2
- Errors in HashMap$$PackageHelper HOT 3
- cannot running with kapt HOT 1
- Parceler: Code generation did not complete successfully. org.parceler.transfuse.transaction.TransactionRuntimeException: Encountered ErrorType <error>, unable to recover HOT 4
- [Request Feature] Support for Kotlin Symbol Processing
- Parceler code generation fails on AS 2023.3.1
- Getters and Setter Alphabetically Order for Write and Read
- Not sure how to convert a Cursor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parceler.