-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix SignChangeEvent NPE (& external list mutability) #12423
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.
Alrea 8000 dy on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
MM did a pull request on this way back which was never merged (#9468). That PR used empty components and a non-null transforming list instead of explicit nulls in the lists - would it be easier to work with the lines if those were used instead? |
Oh, haven't seen that PR, thanks for the info! Missed I do agree that getting rid of nulls would be better, but this will break backwards compatibility, and sadly the event existed in this state for years now.
|
We definitely cannot break the non null contract on the lines getters/setters. But yea, "breaking" (eventho yea, it has been technically broken) newer API in favour of older ones, *especially when this has been the case since 1.16.5 and hence been part of the API for more than 4 years now is not a change I'd be happy with. |
Any update on this? Given that it bundles the isInRaitOrWater check, it is a bit too on my radar. |
getLine() / getLines() / legacy constructor no longer NPE Sign lines now correctly show nullability
Mandate exactly 4 lines Prevent external lines modification
I've moved the first two commits into a separate PR (#12462) given that the sign changes seem stuck.
To clarify, the changes in this PR do not break the null contract.
If we remove the
@Machine-Maker, thoughts? With your prior changes in #9468, would be nice to hear opinions |
thank you!
I do think MM's original PR is nicer in this regard yea, tho yea you are also right, I missed the fact that the component ones are nullable already. Presumably only due to the fact that legacy strings have that nasty habit.
I'd be at least. Something going from nullable to non null is generally fine as the non null version could have already been in there. Especially for components, for legacy strings yea, we might be able to find some hacky way to yield back null.
Ah yes, the bane of everyones existence, mutable lists. I hate them with a passion tho yea, that is the bit that I'd be most worried about breaking. MM's PR introduced a nag for this, which sounds like a solid solution for this issue. |
getLine()
/getLines()
/ legacy String[] constructorgetLine()
/line()
/ constructor now correctly show nullabilityI'm sorry this grew a liiiiiiiiiitle bigger than initially planned as changes just snowballed 🫠Can be easily split if any of the changes are debatable.
Edit: split into #12462