- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.6k
[java] Add nullness for logging #15108
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
Conversation
| Fixed NullAway errors:  | 
| PR Reviewer Guide 🔍Here are some key observations to aid the review process: 
 | 
| PR Code Suggestions ✨Explore these optional code suggestions: 
 | 
Co-authored-by: Viet Nguyen Duc <[email protected]>
Co-authored-by: Viet Nguyen Duc <[email protected]>
User description
Description
In this PR I'm adding nullness annotations for classes:
org.openqa.selenium.logging.LogEntriesorg.openqa.selenium.logging.LogEntryorg.openqa.selenium.logging.LogLevelMappingorg.openqa.selenium.logging.SessionLogsNullAway analysis: #14421
Motivation and Context
The JSpecify nullness annotations will give developers better exposure to potential problems with their code to avoid NullPointerExceptions.
Related issue: #14291
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
Added JSpecify
@NullMarkedannotations to logging-related classes.Enhanced null handling in
LogLevelMappingwithOptional.Improved null safety in
SessionLogsusingRequire.nonNull.Added test case for null log level handling in
LoggingTest.Changes walkthrough 📝
LogEntries.java
Add `@NullMarked` annotation to `LogEntries`.java/src/org/openqa/selenium/logging/LogEntries.java
@NullMarkedannotation to the class.LogEntry.java
Add `@NullMarked` annotation to `LogEntry`.java/src/org/openqa/selenium/logging/LogEntry.java
@NullMarkedannotation to the class.LogLevelMapping.java
Enhance null handling in `LogLevelMapping`.java/src/org/openqa/selenium/logging/LogLevelMapping.java
@NullMarkedannotation to the class.@NullablefortoLevelparameter.Optionalfor null-safe log level mapping.SessionLogs.java
Improve null safety in `SessionLogs`.java/src/org/openqa/selenium/logging/SessionLogs.java
@NullMarkedannotation to the class.Require.nonNullfor null safety infromJSON.LoggingTest.java
Add test for null log level in `LoggingTest`.java/test/org/openqa/selenium/logging/LoggingTest.java