Skip to content
Permalink
Browse files
FILEUPLOAD-313 - Remove redundant local variable
  • Loading branch information
arturobernalg committed Apr 22, 2021
1 parent b825323 commit bc47cab7e607dec3f966d192907ff9e74d4e2ed8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
@@ -76,10 +76,7 @@ public static final boolean isMultipartContent(final RequestContext ctx) {
if (contentType == null) {
return false;
}
if (contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART)) {
return true;
}
return false;
return contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART);
}

/**
@@ -343,8 +343,7 @@ public String getContentType() {
*/
@Override
public ServletInputStream getInputStream() throws IOException {
final ServletInputStream sis = new MyServletInputStream(m_requestData, readLimit);
return sis;
return new MyServletInputStream(m_requestData, readLimit);
}

/**
@@ -182,8 +182,7 @@ private List<FileItem> parseUpload(final InputStream pStream, final int pLength)
final HttpServletRequest request = new MockHttpServletRequest(pStream,
pLength, contentType);

final List<FileItem> fileItems = upload.parseRequest(new ServletRequestContext(request));
return fileItems;
return upload.parseRequest(new ServletRequestContext(request));
}

private String getHeader(final String pField) {
@@ -40,8 +40,7 @@ public static List<FileItem> parseUpload(final FileUpload upload, final byte[] b

public static List<FileItem> parseUpload(final FileUpload upload, final byte[] bytes, final String contentType) throws FileUploadException {
final HttpServletRequest request = new MockHttpServletRequest(bytes, contentType);
final List<FileItem> fileItems = upload.parseRequest(new ServletRequestContext(request));
return fileItems;
return upload.parseRequest(new ServletRequestContext(request));
}

public static List<FileItem> parseUpload(final FileUpload upload, final String content)
@@ -357,8 +357,7 @@ public String getContentType() {
*/
@Override
public ServletInputStream getInputStream() throws IOException {
final ServletInputStream sis = new MyServletInputStream(m_requestData, readLimit);
return sis;
return (ServletInputStream) new MyServletInputStream(m_requestData, readLimit);
}

/**

0 comments on commit bc47cab

Please sign in to comment.