-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[java] Add nullness for logging #15108
base: trunk
Are you sure you want to change the base?
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:
|
User description
Description
In this PR I'm adding nullness annotations for classes:
org.openqa.selenium.logging.LogEntries
org.openqa.selenium.logging.LogEntry
org.openqa.selenium.logging.LogLevelMapping
org.openqa.selenium.logging.SessionLogs
NullAway 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
@NullMarked
annotations to logging-related classes.Enhanced null handling in
LogLevelMapping
withOptional
.Improved null safety in
SessionLogs
usingRequire.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
@NullMarked
annotation to the class.LogEntry.java
Add `@NullMarked` annotation to `LogEntry`.
java/src/org/openqa/selenium/logging/LogEntry.java
@NullMarked
annotation to the class.LogLevelMapping.java
Enhance null handling in `LogLevelMapping`.
java/src/org/openqa/selenium/logging/LogLevelMapping.java
@NullMarked
annotation to the class.@Nullable
fortoLevel
parameter.Optional
for null-safe log level mapping.SessionLogs.java
Improve null safety in `SessionLogs`.
java/src/org/openqa/selenium/logging/SessionLogs.java
@NullMarked
annotation to the class.Require.nonNull
for null safety infromJSON
.LoggingTest.java
Add test for null log level in `LoggingTest`.
java/test/org/openqa/selenium/logging/LoggingTest.java