-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed as not planned
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement
Description
Overview
Types like ResultSetExtractor<T> where the return type nullness depends on the generic type nullness should have their declaration improved to be more flexible as defined in JSpecify generic type documentation.
So the current declaration and similar patterns
@FunctionalInterface
public interface ResultSetExtractor<T> {
@Nullable T extractData(ResultSet rs) throws SQLException, DataAccessException;
}Should be updated to
@FunctionalInterface
public interface ResultSetExtractor<T extends @Nullable Object> {
T extractData(ResultSet rs) throws SQLException, DataAccessException;
}Unless I am mistaken, since ResultSetExtractor<T> is syntaxic sugar for ResultSetExtractor<T extends Object>, declaring ResultSetExtractor<T extends @Nullable Object> should not break the compatibility for users not using checkers like NullAway. If they do and they are using nullable type, the breakage is on purpose and will allow them to specify ResultSetExtractor<@Nullable T> on usage side.
Related Issues
sbrannen
Metadata
Metadata
Assignees
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement