Skip to content

Commit

Permalink
Revert some null-safety changes
Browse files Browse the repository at this point in the history
This commit reverts some null-safety changes which make sense
on main but are too impactful for 6.1.x for Kotlin developers
using -Xjsr305=strict.

See spring-projectsgh-32475
  • Loading branch information
sdeleuze committed Apr 5, 2024
1 parent 4a7c24d commit 7a666cf
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -907,13 +907,11 @@ public <T> T queryForObject(String sql, Object[] args, int[] argTypes, Class<T>

@Deprecated
@Override
@Nullable
public <T> T queryForObject(String sql, @Nullable Object[] args, Class<T> requiredType) throws DataAccessException {
return queryForObject(sql, args, getSingleColumnRowMapper(requiredType));
}

@Override
@Nullable
public <T> T queryForObject(String sql, Class<T> requiredType, @Nullable Object... args) throws DataAccessException {
return queryForObject(sql, args, getSingleColumnRowMapper(requiredType));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ private HttpSession obtainSession() {


@Override
@Nullable
public Object getAttribute(String name, int scope) {
if (scope == SCOPE_REQUEST) {
if (!isRequestActive()) {
Expand Down Expand Up @@ -243,7 +242,6 @@ public void registerDestructionCallback(String name, Runnable callback, int scop
}

@Override
@Nullable
public Object resolveReference(String key) {
if (REFERENCE_REQUEST.equals(key)) {
return this.request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,16 @@ public Object getNativeRequest() {
}

@Override
@Nullable
public Object getNativeResponse() {
return getResponse();
}

@Override
@Nullable
public <T> T getNativeRequest(@Nullable Class<T> requiredType) {
return WebUtils.getNativeRequest(getRequest(), requiredType);
}

@Override
@Nullable
public <T> T getNativeResponse(@Nullable Class<T> requiredType) {
HttpServletResponse response = getResponse();
return (response != null ? WebUtils.getNativeResponse(response, requiredType) : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ public int getRemotePort() {

@SuppressWarnings("DataFlowIssue")
@Override
@Nullable
public Object getAttribute(String name) {
if (name.equals(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)) {
return this.forwardedPrefixExtractor.getErrorRequestUri();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public long contentLength() {
}

@Override
@Nullable
public String getFilename() {
return this.multipartFile.getOriginalFilename();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ protected final void setMultipartParameters(Map<String, String[]> multipartParam
* lazily initializing it if necessary.
* @see #initializeMultipart()
*/
@SuppressWarnings("NullAway")
protected Map<String, String[]> getMultipartParameters() {
if (this.multipartParameters == null) {
initializeMultipart();
Expand All @@ -190,7 +189,6 @@ protected final void setMultipartParameterContentTypes(Map<String, String> multi
* lazily initializing it if necessary.
* @see #initializeMultipart()
*/
@SuppressWarnings("NullAway")
protected Map<String, String> getMultipartParameterContentTypes() {
if (this.multipartParameterContentTypes == null) {
initializeMultipart();
Expand Down

0 comments on commit 7a666cf

Please sign in to comment.