You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jo...@apache.org on 2021/05/27 20:46:52 UTC

[commons-fileupload] branch master updated: Use UploadContext instead Deprecated method (RequestContext)

This is an automated email from the ASF dual-hosted git repository.

jochen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git


The following commit(s) were added to refs/heads/master by this push:
     new d690ffd  Use UploadContext instead Deprecated method (RequestContext)
     new f26e824  Merge pull request #97 from arturobernalg/feature/uploadContext
d690ffd is described below

commit d690ffd31700c011b08a30d80d073af446d8fbed
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Thu May 27 22:01:37 2021 +0200

    Use UploadContext instead Deprecated method (RequestContext)
---
 .../org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java   | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
index 2044d06..6143270 100644
--- a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
+++ b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
@@ -138,11 +138,7 @@ public class FileItemIteratorImpl implements FileItemIterator {
                     format("the request doesn't contain a %s or %s stream, content type header is %s",
                            FileUploadBase.MULTIPART_FORM_DATA, FileUploadBase.MULTIPART_MIXED, contentType));
         }
-
-
-        @SuppressWarnings("deprecation") // still has to be backward compatible
-        final int contentLengthInt = ctx.getContentLength();
-
+        final long contentLengthInt = ((UploadContext) ctx).contentLength();
         final long requestSize = UploadContext.class.isAssignableFrom(ctx.getClass())
                                  // Inline conditional is OK here CHECKSTYLE:OFF
                                  ? ((UploadContext) ctx).contentLength()