Skip to content
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

Nullable and modernization part 6 #132

Conversation

erikmav
Copy link
Contributor

@erikmav erikmav commented Mar 27, 2024

Adjusted nullability on some classes after applying the 3.0 binary to two existing projects that have nullable enabled. Changed nullable warnings to errors.

@erikmav
Copy link
Contributor Author

erikmav commented Mar 27, 2024

For #124

@FreeAndNil FreeAndNil changed the base branch from master to Feature/111-Dropping-support-for-older-runtimes March 28, 2024 06:08
Copy link
Contributor

@FreeAndNil FreeAndNil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot.
I will test the API with our libraries.

@FreeAndNil FreeAndNil merged commit bb86fea into apache:Feature/111-Dropping-support-for-older-runtimes Mar 28, 2024
1 check failed
@erikmav erikmav deleted the dev/erikmav/nullableAndModernization6 branch March 28, 2024 16:14
@erikmav
Copy link
Contributor Author

erikmav commented Mar 28, 2024

@FreeAndNil the ugliest adaptations I had to make with the new binary:

  • Level? on LoggingEvent and its internal data structure required adding a bunch of null checks, especially where there are comparisons of levels. Lots of these in 2 repos. It would be ideal to make that non-nullable and ensure it's set to some default like Level.Off or similar.
  • Repository? on Logger required adding null checks. Generally speaking this is never null in practice, but I don't see what default to set it to.

@erikmav
Copy link
Contributor Author

erikmav commented Mar 28, 2024

@FreeAndNil I just tried setting LoggingEvent.Level to non-nullable and set to Level.All. Problem is that null is converted into different policies by different appenders (Debug, Info, or All) so a blanket All policy does not work. Seems like it needs to be left nullable for back compat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants