-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider warning if a final variable is changed via readMarshallable #414
Comments
We should be more abrupt and throw an exception, the problem with WARNings is they get missed! |
Let's do warning now, error in 2.24? |
alamar
added a commit
that referenced
this issue
Mar 23, 2022
Turns out we have more than 10 tests which do exactly that - overwrite final fields. What should we do - should we update them all? |
alamar
added a commit
that referenced
this issue
Apr 21, 2022
alamar
added a commit
to OpenHFT/Chronicle-Queue
that referenced
this issue
Apr 22, 2022
alamar
added a commit
that referenced
this issue
Apr 22, 2022
De-finalize marshallable fields to remove warnings closes #414
alamar
added a commit
to OpenHFT/Chronicle-Queue
that referenced
this issue
Apr 25, 2022
@alamar this looks done, if this is not the case please reopen |
Nope, no real work is done yet, reopening. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
readMarshallable allows final variables to be changed - eg when reading config on startup.
As Java allows aggressive optimisation of final variables this can result in a situation where a variable in an object has one value (changed from config), but accessors will return a different value (a default baked in at compilation).
Ideally a warning should be emitted when a final variable is changed, or the config refused altogether.
The text was updated successfully, but these errors were encountered: