Skip to content

Commit 6c78c18

Browse files
committed
[http.base] throw new ServletException on
According to the servlet spec, this method either throws a ServletException if the request is not a multipart request or always returns a collection. It never returns null. Throwing an exception seems to be the right thing. (Karsten Ziegeler) Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
1 parent 748a935 commit 6c78c18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletRequestWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,12 @@ public boolean isAsyncSupported()
384384
@Override
385385
@SuppressWarnings({ "unchecked", "rawtypes" })
386386
public Collection<Part> getParts() throws IOException, ServletException {
387-
return null;
387+
throw new ServletException("No Multipart-Support available");
388388
}
389389

390390
@Override
391391
public Part getPart(String name) throws IOException, ServletException {
392-
return null;
392+
throw new ServletException("No Multipart-Support available");
393393
}
394394

395395
@Override

0 commit comments

Comments
 (0)