Skip to content

Commit 9e7c642

Browse files
committed
Merge branch '6.1.x'
2 parents 69dabe9 + dc1ef23 commit 9e7c642

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spring-web/src/main/java/org/springframework/http/converter/ResourceHttpMessageConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -113,6 +113,7 @@ protected MediaType getDefaultContentType(Resource resource) {
113113
}
114114

115115
@Override
116+
@Nullable
116117
protected Long getContentLength(Resource resource, @Nullable MediaType contentType) throws IOException {
117118
// Don't try to determine contentLength on InputStreamResource - cannot be read afterwards...
118119
// Note: custom InputStreamResource subclasses could provide a pre-calculated content length!

spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -561,6 +561,7 @@ protected MediaType getDefaultContentType(Object object) throws IOException {
561561
}
562562

563563
@Override
564+
@Nullable
564565
protected Long getContentLength(Object object, @Nullable MediaType contentType) throws IOException {
565566
if (object instanceof MappingJacksonValue mappingJacksonValue) {
566567
object = mappingJacksonValue.getValue();

0 commit comments

Comments
 (0)