[java] JSpecify annotations for org.openqa.selenium.net#16463
[java] JSpecify annotations for org.openqa.selenium.net#16463diemol merged 3 commits intoSeleniumHQ:trunkfrom
org.openqa.selenium.net#16463Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
d1db2b9 to
da5d929
Compare
|
I will merge this as the failures are unrelated. |
User description
🔗 Related Issues
Related #14291
💥 What does this PR do?
JSpecify annotations added to the:
org.openqa.selenium.net.LinuxEphemeralPortRangeDetectororg.openqa.selenium.net.NetworkUtilsorg.openqa.selenium.net.PortProberorg.openqa.selenium.net.UrlCheckerorg.openqa.selenium.net.Urls🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add JSpecify @NullMarked annotations to five net package classes
Mark nullable fields and return types with @nullable annotation
Add null-safety checks using Require.nonNull() for guaranteed non-null returns
Improve type safety and null-handling in NetworkUtils class
Diagram Walkthrough
File Walkthrough
LinuxEphemeralPortRangeDetector.java
Add JSpecify @NullMarked annotationjava/src/org/openqa/selenium/net/LinuxEphemeralPortRangeDetector.java
NetworkUtils.java
Add comprehensive null-safety annotations and checksjava/src/org/openqa/selenium/net/NetworkUtils.java
(cachedIp4NonLoopbackAddressOfThisMachine,
cachedIp4NonLoopbackAddressHostName, hostname, address)
methods
(getNonLoopbackAddressOfThisMachine, obtainLoopbackIp4Address,
getIpOfLoopBackIp4)
obtainLoopbackIp4Address()
PortProber.java
Add JSpecify @NullMarked annotationjava/src/org/openqa/selenium/net/PortProber.java
UrlChecker.java
Add JSpecify @NullMarked annotationjava/src/org/openqa/selenium/net/UrlChecker.java
Urls.java
Add JSpecify @NullMarked annotationjava/src/org/openqa/selenium/net/Urls.java