You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSpecify JDK models: System.getProperty(String, String) with a non-null default is reported as @Nullable #2061
With JSpecifyExperimental, NullAway reports the result of System.getProperty(String, String) as @Nullable, also when the default value is a non-null literal.
The same happens for Properties.getProperty(String, String).
The result is null only when the property is missing and the default value is null.
So the return value has the same nullness as the default value.
Suggestion
#1813 added @PolyNull library models for Optional.orElseGet and Map.computeIfAbsent, for the same kind of false positive (#1616).
The two methods above could get the same model in POLY_NULL_LOCATIONS: the default value parameter and the return value as @PolyNull locations.
Versions
NullAway 0.14.3
Error Prone 2.51.0
JDK 25.0.4 (Amazon Corretto)
Reacted by Manu Sridharan, Nils, Fabian Stürz and SirCotare
Activity
Model getProperty return nullness from its default value (apache#2062)