Skip to content

Commit 8c62a2f

Browse files
committed
Polishing
(cherry picked from commit 95330d0)
1 parent 8656e30 commit 8c62a2f

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

spring-web/src/main/java/org/springframework/http/HttpStatus.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -128,7 +128,7 @@ public enum HttpStatus {
128128
/**
129129
* {@code 302 Moved Temporarily}.
130130
* @see <a href="http://tools.ietf.org/html/rfc1945#section-9.3">HTTP/1.0, section 9.3</a>
131-
* @deprecated In favor of {@link #FOUND} which will be returned from {@code HttpStatus.valueOf(302)}
131+
* @deprecated in favor of {@link #FOUND} which will be returned from {@code HttpStatus.valueOf(302)}
132132
*/
133133
@Deprecated
134134
MOVED_TEMPORARILY(302, "Moved Temporarily"),
@@ -236,7 +236,7 @@ public enum HttpStatus {
236236
/**
237237
* {@code 413 Request Entity Too Large}.
238238
* @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.14">HTTP/1.1, section 10.4.14</a>
239-
* @deprecated In favor of {@link #PAYLOAD_TOO_LARGE} which will be returned from {@code HttpStatus.valueOf(413)}
239+
* @deprecated in favor of {@link #PAYLOAD_TOO_LARGE} which will be returned from {@code HttpStatus.valueOf(413)}
240240
*/
241241
@Deprecated
242242
REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"),
@@ -249,7 +249,7 @@ public enum HttpStatus {
249249
/**
250250
* {@code 414 Request-URI Too Long}.
251251
* @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.15">HTTP/1.1, section 10.4.15</a>
252-
* @deprecated In favor of {@link #URI_TOO_LONG} which will be returned from {@code HttpStatus.valueOf(414)}
252+
* @deprecated in favor of {@link #URI_TOO_LONG} which will be returned from {@code HttpStatus.valueOf(414)}
253253
*/
254254
@Deprecated
255255
REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"),

spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -107,15 +107,11 @@ private void parseRequest(HttpServletRequest request) {
107107
}
108108
setMultipartFiles(files);
109109
}
110-
catch (Exception ex) {
110+
catch (Throwable ex) {
111111
throw new MultipartException("Could not parse multipart servlet request", ex);
112112
}
113113
}
114114

115-
private String extractFilename(String contentDisposition) {
116-
return extractFilename(contentDisposition, FILENAME_KEY);
117-
}
118-
119115
private String extractFilename(String contentDisposition, String key) {
120116
if (contentDisposition == null) {
121117
return null;
@@ -140,6 +136,10 @@ private String extractFilename(String contentDisposition, String key) {
140136
return filename;
141137
}
142138

139+
private String extractFilename(String contentDisposition) {
140+
return extractFilename(contentDisposition, FILENAME_KEY);
141+
}
142+
143143
private String extractFilenameWithCharset(String contentDisposition) {
144144
String filename = extractFilename(contentDisposition, FILENAME_WITH_CHARSET_KEY);
145145
if (filename == null) {
@@ -220,7 +220,7 @@ public String getMultipartContentType(String paramOrFileName) {
220220
Part part = getPart(paramOrFileName);
221221
return (part != null ? part.getContentType() : null);
222222
}
223-
catch (Exception ex) {
223+
catch (Throwable ex) {
224224
throw new MultipartException("Could not access multipart servlet request", ex);
225225
}
226226
}
@@ -240,7 +240,7 @@ public HttpHeaders getMultipartHeaders(String paramOrFileName) {
240240
return null;
241241
}
242242
}
243-
catch (Exception ex) {
243+
catch (Throwable ex) {
244244
throw new MultipartException("Could not access multipart servlet request", ex);
245245
}
246246
}

spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -42,6 +42,9 @@
4242
*
4343
* @author Juergen Hoeller
4444
* @since 3.1
45+
* @see #setResolveLazily
46+
* @see HttpServletRequest#getParts()
47+
* @see org.springframework.web.multipart.commons.CommonsMultipartResolver
4548
*/
4649
public class StandardServletMultipartResolver implements MultipartResolver {
4750

@@ -87,7 +90,7 @@ public void cleanupMultipart(MultipartHttpServletRequest request) {
8790
}
8891
}
8992
}
90-
catch (Exception ex) {
93+
catch (Throwable ex) {
9194
LogFactory.getLog(getClass()).warn("Failed to perform cleanup of multipart items", ex);
9295
}
9396
}

0 commit comments

Comments
 (0)