(commons-lang) branch master updated: Fixing the previous commit.

2024-05-22 Thread jochen
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-lang.git


The following commit(s) were added to refs/heads/master by this push:
 new 1e64e11e7 Fixing the previous commit.
1e64e11e7 is described below

commit 1e64e11e747b03a8d49c293c18847b3a9e65fcfb
Author: Jochen Wiedmann 
AuthorDate: Thu May 23 00:05:37 2024 +0200

Fixing the previous commit.
---
 .mvn/.gitignore|   4 +
 .../commons/lang3/annotations/AnnotationsTest.java | 122 -
 2 files changed, 4 insertions(+), 122 deletions(-)

diff --git a/.mvn/.gitignore b/.mvn/.gitignore
new file mode 100644
index 0..f26bafb8b
--- /dev/null
+++ b/.mvn/.gitignore
@@ -0,0 +1,4 @@
+#
+# Empty file (Maven 4 wants the directory .mvn to be present,
+# and we want Git to create it.)
+#
diff --git 
a/src/test/java/org/apache/commons/lang3/annotations/AnnotationsTest.java 
b/src/test/java/org/apache/commons/lang3/annotations/AnnotationsTest.java
deleted file mode 100644
index df1aa70f3..0
--- a/src/test/java/org/apache/commons/lang3/annotations/AnnotationsTest.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.annotations;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertSame;
-
-import java.lang.annotation.Target;
-import java.util.function.Function;
-
-import org.junit.jupiter.api.Test;
-
-
-/** This class ensures, that the annotations are properly configured
- * with regard to {@link Target}.
- *
- * The so-called test methods are not actually testing anything, because
- * an invalid configuration would be detected by the compiler. However,
- * we have the unit test framework in place, and it is running anyways,
- * so there's no harm in a few additional methods.
- */
-public class AnnotationsTest {
-public static class Wrapper {
-private final Object wrappedObject;
-
-@Insecure
-public Wrapper(Object wrappedObject) {
-this.wrappedObject = wrappedObject;
-}
-
-Object getWrappedObject() {
-return wrappedObject;
-}
-}
-
-private static Wrapper newWrapper(Object wrappedObject) {
-return new Wrapper(wrappedObject);
-}
-
-/** Test, whether we can have an @Insecure annotation on a constructor.
- */
-@Test
-public void testConstructorAnnotatableAsInsecure() {
-final Object unsafeObject = new Object();
-// Static code analysis should reject this, because the
-// parameter (the newly created instance of Object) isn't known
-// to be safe.
-final Wrapper wrapper = new Wrapper(unsafeObject);
-assertNotNull(wrapper);
-assertSame(unsafeObject, wrapper.getWrappedObject());
-}
-
-/** Test, whether we can have an @Insecure annotation on a method.
- */
-@Test
-public void testMethodAnnotatableAsInsecure() {
-final Object unsafeObject = new Object();
-// Static code analysis should reject this, because the
-// parameter (the newly created instance of Object) isn't known
-// to be safe.
-final Wrapper wrapper = newWrapper(unsafeObject);
-assertNotNull(wrapper);
-assertSame(unsafeObject, wrapper.getWrappedObject());
-}
-
-/** Test, whether we can have a @Safe annotation on a local variable.
- */
-@Test
-public void testLocalVariablesAnnotatableAsSafe() {
-@Safe final String wrappedString = "Hello, world!";
-// Static code analysis should accept this, because the variable
-// is annotated with @Safe.
-final Wrapper wrapper = newWrapper(wrappedString);
-assertNotNull(wrapper);
-assertSame(wrappedString, wrapper.getWrappedObject());
-}
-
-/** Test, whether we can have a @Safe annotation on a field.
- */
-@Test
-public void testFieldsAnnotatableAsSafe() {
-// Static code analysis should accept this, because the field
-// is annota

(commons-lang) branch master updated: Undoing 3322d974876b8d4f934d3544967103ebbcaef726

2024-05-22 Thread jochen
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-lang.git


The following commit(s) were added to refs/heads/master by this push:
 new 9980cf11e Undoing 3322d974876b8d4f934d3544967103ebbcaef726
9980cf11e is described below

commit 9980cf11e36ee58bf8556188bf252946f290b6c8
Author: Jochen Wiedmann 
AuthorDate: Wed May 22 20:00:10 2024 +0200

Undoing 3322d974876b8d4f934d3544967103ebbcaef726
---
 src/changes/changes.xml|  1 -
 .../apache/commons/lang3/annotations/Insecure.java | 48 -
 .../org/apache/commons/lang3/annotations/Safe.java | 61 --
 .../commons/lang3/annotations/package-info.java| 37 -
 4 files changed, 147 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b69e1f8a2..34841687a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -140,7 +140,6 @@ The  type attribute can be add,update,fix,remove.
 Bump org.apache.commons:commons-text from 1.11.0 to 1.12.0 
#1200. 
 
 Drop obsolete JDK 13 Maven profile #1142.
-Added the annotations 
package, including the Insecure, and Safe annotations.
   
   
 
diff --git a/src/main/java/org/apache/commons/lang3/annotations/Insecure.java 
b/src/main/java/org/apache/commons/lang3/annotations/Insecure.java
deleted file mode 100644
index 2802f1189..0
--- a/src/main/java/org/apache/commons/lang3/annotations/Insecure.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.annotations;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * This annotation is used to indicate, that a constructor, or method
- * is insecure to use, unless the input parameters contain safe ("trusted")
- * values.
- *
- * For example, consider a method like 
- *   {@literal @Insecure}
- *   public void runCommand(String pCmdLine) {
- *   }
- * 
- *
- * The example method would invoke {@code /bin/sh} (Linux, Unix, or MacOS), or
- * {@code cmd} (Windows) to run an external command, as given by the parameter
- * {@code pCmdLine}. Obviously, depending on the value of the parameter,
- * this can be dangerous, unless the API user (downstream developer)
- * knows, that the parameter value is safe (for example, because it
- * is hard coded, or because it has been compared to a white list of
- * permissible values).
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.CONSTRUCTOR, ElementType.METHOD})
-@Documented
-public @interface Insecure {
-}
diff --git a/src/main/java/org/apache/commons/lang3/annotations/Safe.java 
b/src/main/java/org/apache/commons/lang3/annotations/Safe.java
deleted file mode 100644
index c3a710cf2..0
--- a/src/main/java/org/apache/commons/lang3/annotations/Safe.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.annotations;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Targ

(commons-lang) branch master updated: Minor documentation fixes.

2024-05-16 Thread jochen
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-lang.git


The following commit(s) were added to refs/heads/master by this push:
 new 797f9a4f5 Minor documentation fixes.
797f9a4f5 is described below

commit 797f9a4f5d8746a8c2c5dc28c422176ead897516
Author: Jochen Wiedmann 
AuthorDate: Fri May 17 01:02:06 2024 +0200

Minor documentation fixes.
---
 src/main/java/org/apache/commons/lang3/annotations/Safe.java | 2 +-
 src/main/java/org/apache/commons/lang3/annotations/package-info.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/annotations/Safe.java 
b/src/main/java/org/apache/commons/lang3/annotations/Safe.java
index 4b5212c71..c3a710cf2 100644
--- a/src/main/java/org/apache/commons/lang3/annotations/Safe.java
+++ b/src/main/java/org/apache/commons/lang3/annotations/Safe.java
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * This annotation is used to indicate, that a variable, field, or parameter
  * contains a safe value. If so, the annotated element may be used in an
  * invocation of a constructor, or method, which is annotated with
- * {@code @Trusted}.
+ * {@code @Insecure}.
  *
  * For example, suggest the following method declaration:
  * 
diff --git 
a/src/main/java/org/apache/commons/lang3/annotations/package-info.java 
b/src/main/java/org/apache/commons/lang3/annotations/package-info.java
index 43d54d606..720d61069 100644
--- a/src/main/java/org/apache/commons/lang3/annotations/package-info.java
+++ b/src/main/java/org/apache/commons/lang3/annotations/package-info.java
@@ -30,7 +30,7 @@
  *   By annotating a variable with {@code @Safe}, the API user
  * declares, that the variable contains trusted input, that can be
  * used as a parameter in an invocation of a constructor, or method,
- * that is annotated with {@code @Trusted}.
+ * that is annotated with {@code @Insecure}.
  * 
  * @since 3.15
  */



(commons-lang) branch master updated: Adding the @Insecure, and @Safe annotations.

2024-05-16 Thread jochen
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-lang.git


The following commit(s) were added to refs/heads/master by this push:
 new 3322d9748 Adding the @Insecure, and @Safe annotations.
3322d9748 is described below

commit 3322d974876b8d4f934d3544967103ebbcaef726
Author: Jochen Wiedmann 
AuthorDate: Fri May 17 00:28:39 2024 +0200

Adding the @Insecure, and @Safe annotations.
---
 src/changes/changes.xml|   1 +
 .../apache/commons/lang3/annotations/Insecure.java |  48 
 .../org/apache/commons/lang3/annotations/Safe.java |  61 +++
 .../commons/lang3/annotations/package-info.java|  37 +++
 .../commons/lang3/annotations/AnnotationsTest.java | 122 +
 5 files changed, 269 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 34841687a..b69e1f8a2 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -140,6 +140,7 @@ The  type attribute can be add,update,fix,remove.
 Bump org.apache.commons:commons-text from 1.11.0 to 1.12.0 
#1200. 
 
 Drop obsolete JDK 13 Maven profile #1142.
+Added the annotations 
package, including the Insecure, and Safe annotations.
   
   
 
diff --git a/src/main/java/org/apache/commons/lang3/annotations/Insecure.java 
b/src/main/java/org/apache/commons/lang3/annotations/Insecure.java
new file mode 100644
index 0..2802f1189
--- /dev/null
+++ b/src/main/java/org/apache/commons/lang3/annotations/Insecure.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.lang3.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation is used to indicate, that a constructor, or method
+ * is insecure to use, unless the input parameters contain safe ("trusted")
+ * values.
+ *
+ * For example, consider a method like 
+ *   {@literal @Insecure}
+ *   public void runCommand(String pCmdLine) {
+ *   }
+ * 
+ *
+ * The example method would invoke {@code /bin/sh} (Linux, Unix, or MacOS), or
+ * {@code cmd} (Windows) to run an external command, as given by the parameter
+ * {@code pCmdLine}. Obviously, depending on the value of the parameter,
+ * this can be dangerous, unless the API user (downstream developer)
+ * knows, that the parameter value is safe (for example, because it
+ * is hard coded, or because it has been compared to a white list of
+ * permissible values).
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.CONSTRUCTOR, ElementType.METHOD})
+@Documented
+public @interface Insecure {
+}
diff --git a/src/main/java/org/apache/commons/lang3/annotations/Safe.java 
b/src/main/java/org/apache/commons/lang3/annotations/Safe.java
new file mode 100644
index 0..4b5212c71
--- /dev/null
+++ b/src/main/java/org/apache/commons/lang3/annotations/Safe.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.lang3.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Re

(commons-io) branch master updated: add test for IO-128

2023-12-21 Thread jochen
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-io.git


The following commit(s) were added to refs/heads/master by this push:
 new 64a2059e add test for IO-128
 new 12453a3a Merge pull request #532 from elharo/IO-128
64a2059e is described below

commit 64a2059eb64e5131738fc5ed9541ed6627c0f3f1
Author: Elliotte Rusty Harold 
AuthorDate: Wed Dec 20 19:04:16 2023 -0500

add test for IO-128
---
 src/test/java/org/apache/commons/io/FilenameUtilsTest.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/java/org/apache/commons/io/FilenameUtilsTest.java 
b/src/test/java/org/apache/commons/io/FilenameUtilsTest.java
index 071ea94e..00618f9b 100644
--- a/src/test/java/org/apache/commons/io/FilenameUtilsTest.java
+++ b/src/test/java/org/apache/commons/io/FilenameUtilsTest.java
@@ -202,6 +202,7 @@ public class FilenameUtilsTest {
 assertEquals(WINDOWS, 
FilenameUtils.equalsNormalizedOnSystem("file.txt", "FILE.TXT"));
 assertTrue(FilenameUtils.equalsNormalizedOnSystem("a\\b\\file.txt", 
"a/b/file.txt"));
 assertFalse(FilenameUtils.equalsNormalizedOnSystem("a/b/", "a/b"));
+assertFalse(FilenameUtils.equalsNormalizedOnSystem("//a.html", 
"//ab.html"));
 }
 
 @Test



(commons-io) branch master updated: remove some unused variables Eclipse warned about

2023-12-21 Thread jochen
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-io.git


The following commit(s) were added to refs/heads/master by this push:
 new aeffacde remove some unused variables Eclipse warned about
 new 29dc5ea0 Merge pull request #531 from elharo/unused2
aeffacde is described below

commit aeffacde1f2518aea5648225cbb86670c4e8c293
Author: Elliotte Rusty Harold 
AuthorDate: Wed Dec 20 18:28:05 2023 -0500

remove some unused variables Eclipse warned about
---
 src/test/java/org/apache/commons/io/FileUtilsTest.java | 1 -
 src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java | 3 +--
 src/test/java/org/apache/commons/io/input/TeeReaderTest.java   | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/FileUtilsTest.java 
b/src/test/java/org/apache/commons/io/FileUtilsTest.java
index 2a67be47..15a31473 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsTest.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsTest.java
@@ -1914,7 +1914,6 @@ public class FileUtilsTest extends AbstractTempDirTest {
 iterateFilesAndDirs(subDir1, fileFilterAllFiles, 
fileFilterAllDirs, expectedFilesAndDirs);
 //
 // "*.txt" and "*"
-final int filesCount;
 expectedFilesAndDirs = Arrays.asList(subDir1, subDir2, someFile, 
subDir3, subDir4);
 iterateFilesAndDirs(subDir1, fileFilterExtTxt, fileFilterAllDirs, 
expectedFilesAndDirs);
 //
diff --git 
a/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java 
b/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
index b8684781..182d014b 100644
--- a/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
@@ -134,8 +134,7 @@ public abstract class AbstractInputStreamTest {
 public void testReadPastEOF() throws IOException {
 final InputStream is = inputStreams[0];
 final byte[] buf = new byte[1024];
-int read;
-while ((read = is.read(buf, 0, buf.length)) != -1) {
+while (is.read(buf, 0, buf.length) != -1) {
 // empty
 }
 
diff --git a/src/test/java/org/apache/commons/io/input/TeeReaderTest.java 
b/src/test/java/org/apache/commons/io/input/TeeReaderTest.java
index c4945258..515ea859 100644
--- a/src/test/java/org/apache/commons/io/input/TeeReaderTest.java
+++ b/src/test/java/org/apache/commons/io/input/TeeReaderTest.java
@@ -66,7 +66,7 @@ public class TeeReaderTest  {
 verify(goodR).close();
 
 final TeeReader closingTr = new TeeReader(goodR, badW, true);
-final IOException e = assertThrows(IOException.class, 
closingTr::close);
+assertThrows(IOException.class, closingTr::close);
 verify(goodR, times(2)).close();
 }
 



[commons-fileupload] branch master updated: FILEUPLOAD-348 - Add tests (already pass in 2.0). (#200)

2023-02-08 Thread jochen
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 a00263b  FILEUPLOAD-348 - Add tests (already pass in 2.0). (#200)
a00263b is described below

commit a00263bb327a01243d84cc5f0afdaf02005805f6
Author: Paul Pogonyshev 
AuthorDate: Wed Feb 8 23:57:48 2023 +0100

FILEUPLOAD-348 - Add tests (already pass in 2.0). (#200)
---
 .../commons/fileupload2/DiskFileItemSerializeTest.java  | 17 +
 1 file changed, 17 insertions(+)

diff --git 
a/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java 
b/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
index 295b857..2166979 100644
--- 
a/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
+++ 
b/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
@@ -87,9 +87,25 @@ public class DiskFileItemSerializeTest {
 } catch (UncheckedIOException e) {
 fail("Unexpected IOException", e);
 }
+testWritingToFile(item, testFieldValueBytes);
 item.delete();
 }
 
+/**
+ * Helper method to test writing item contents to a file.
+ */
+public void testWritingToFile(final FileItem item, final byte[] 
testFieldValueBytes) {
+try {
+final File temp = File.createTempFile("fileupload", null);
+// Note that the file exists and is initially empty;
+// write() must be able to handle that.
+item.write(temp);
+compareBytes("Initial", FileUtils.readFileToByteArray(temp), 
testFieldValueBytes);
+} catch (Exception e) {
+fail("Unexpected Exception", e);
+}
+}
+
 /**
  * Helper method to test creation of a field.
  */
@@ -138,6 +154,7 @@ public class DiskFileItemSerializeTest {
 fail("Unexpected IOException", e);
 }
 
+testWritingToFile(item, testFieldValueBytes);
 item.delete();
 }
 



[commons-fileupload] branch master updated: Add a new limit for the number of files uploaded per request (#185)

2022-12-14 Thread jochen
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 6601954  Add a new limit for the number of files uploaded per request 
(#185)
6601954 is described below

commit 6601954fd1f36f0c3b1fe97f213e232a2ea63588
Author: Mark Thomas 
AuthorDate: Wed Dec 14 09:32:46 2022 +

Add a new limit for the number of files uploaded per request (#185)
---
 src/changes/changes.xml|  1 +
 .../apache/commons/fileupload2/FileUploadBase.java | 29 
 .../pub/FileCountLimitExceededException.java   | 53 ++
 3 files changed, 83 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a70bffc..f4a8b76 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -55,6 +55,7 @@ The  type attribute can be add,update,fix,remove.
   Add github/codeql-action from #144.
   Add the package 
org.apache.fileupload2.jaksrvlt, for compliance with Jakarta Servlet API 
5.0.
   Making 
FileUploadException a subclass of IOException. (Mibor API 
simplification.)
+  Add a configurable 
limit (disabled by default) for the number of files to upload per 
request.
   
   Bump actions/cache from 2.1.6 to 3.0.8 #128, 
#140.
   Bump actions/checkout from 2.3.4 to 3.0.2 
#125.
diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java 
b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index b10eabc..0c49ca1 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -29,6 +29,7 @@ import java.util.Map;
 import java.util.Objects;
 
 import org.apache.commons.fileupload2.impl.FileItemIteratorImpl;
+import org.apache.commons.fileupload2.pub.FileCountLimitExceededException;
 import org.apache.commons.fileupload2.pub.FileUploadIOException;
 import org.apache.commons.fileupload2.pub.IOFileUploadException;
 import org.apache.commons.fileupload2.util.FileItemHeadersImpl;
@@ -140,6 +141,12 @@ public abstract class FileUploadBase {
  */
 private long fileSizeMax = -1;
 
+/**
+ * The maximum permitted number of files that may be uploaded in a single
+ * request. A value of -1 indicates no maximum.
+ */
+private long fileCountMax = -1;
+
 /**
  * The content encoding to use when reading part headers.
  */
@@ -216,6 +223,24 @@ public abstract class FileUploadBase {
 this.fileSizeMax = fileSizeMax;
 }
 
+/**
+ * Returns the maximum number of files allowed in a single request.
+ *
+ * @return The maximum number of files allowed in a single request.
+ */
+public long getFileCountMax() {
+return fileCountMax;
+}
+
+/**
+ * Sets the maximum number of files allowed per request.
+ *
+ * @param fileCountMax The new limit. {@code -1} means no limit.
+ */
+public void setFileCountMax(final long fileCountMax) {
+this.fileCountMax = fileCountMax;
+}
+
 /**
  * Retrieves the character encoding used when reading the headers of an
  * individual part. When not specified, or {@code null}, the request
@@ -290,6 +315,10 @@ public abstract class FileUploadBase {
 "No FileItemFactory has been set.");
 final byte[] buffer = new byte[Streams.DEFAULT_BUFFER_SIZE];
 while (iter.hasNext()) {
+if (items.size() == fileCountMax) {
+// The next item will exceed the limit.
+throw new FileCountLimitExceededException(ATTACHMENT, 
getFileCountMax());
+}
 final FileItemStream item = iter.next();
 // Don't use getName() here to prevent an 
InvalidFileNameException.
 final String fileName = item.getName();
diff --git 
a/src/main/java/org/apache/commons/fileupload2/pub/FileCountLimitExceededException.java
 
b/src/main/java/org/apache/commons/fileupload2/pub/FileCountLimitExceededException.java
new file mode 100644
index 000..ac22341
--- /dev/null
+++ 
b/src/main/java/org/apache/commons/fileupload2/pub/FileCountLimitExceededException.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distribut

[commons-fileupload] branch master updated: Bump ossf/scorecard-action from 2.0.4 to 2.0.6 (#177)

2022-10-21 Thread jochen
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 c3a2cff  Bump ossf/scorecard-action from 2.0.4 to 2.0.6 (#177)
c3a2cff is described below

commit c3a2cff7ece3d22dc5a5d58e40e1b6449bd44f74
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 21 15:38:09 2022 +0200

Bump ossf/scorecard-action from 2.0.4 to 2.0.6 (#177)

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) 
from 2.0.4 to 2.0.6.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- 
[Commits](https://github.com/ossf/scorecard-action/compare/e363bfca00e752f91de7b7d2a77340e2e523cb18...99c53751e09b9529366343771cc321ec74e9bd3d)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] 

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 .github/workflows/scorecards-analysis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/scorecards-analysis.yml 
b/.github/workflows/scorecards-analysis.yml
index 0cad67d..1ee4f55 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -43,7 +43,7 @@ jobs:
   persist-credentials: false
 
   - name: "Run analysis"
-uses: ossf/scorecard-action@e363bfca00e752f91de7b7d2a77340e2e523cb18   
 # 1.1.2
+uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d   
 # 1.1.2
 with:
   results_file: results.sarif
   results_format: sarif



[commons-fileupload] branch master updated: Bump spotbugs-maven-plugin from 4.7.2.0 to 4.7.2.1 (#172)

2022-10-12 Thread jochen
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 0744928  Bump spotbugs-maven-plugin from 4.7.2.0 to 4.7.2.1 (#172)
0744928 is described below

commit 0744928df992c7524a34020e6472ab71be8a93f2
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Oct 12 11:28:59 2022 +0200

Bump spotbugs-maven-plugin from 4.7.2.0 to 4.7.2.1 (#172)

Bumps 
[spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 
4.7.2.0 to 4.7.2.1.
- [Release 
notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- 
[Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.7.2.0...spotbugs-maven-plugin-4.7.2.1)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] 

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 106c2ff..c3397f0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -247,7 +247,7 @@
 
scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}
 Rob Tompkins
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
-4.7.2.0
+4.7.2.1
 4.7.2
 3.2.0
 



[commons-fileupload] branch master updated: Bump actions/cache from 3.0.8 to 3.0.10 (#170)

2022-10-10 Thread jochen
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 b6787ec  Bump actions/cache from 3.0.8 to 3.0.10 (#170)
b6787ec is described below

commit b6787ecc9158fcbfbe28969235849344e6a5fdc6
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Mon Oct 10 09:56:49 2022 +0200

Bump actions/cache from 3.0.8 to 3.0.10 (#170)

Bumps [actions/cache](https://github.com/actions/cache) from 3.0.8 to 
3.0.10.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.8...v3.0.10)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] 

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 .github/workflows/codeql-analysis.yml | 2 +-
 .github/workflows/coverage.yml| 2 +-
 .github/workflows/maven.yml   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/codeql-analysis.yml 
b/.github/workflows/codeql-analysis.yml
index b7386af..786802a 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -48,7 +48,7 @@ jobs:
   uses: actions/checkout@v3.0.2
   with:
 persist-credentials: false
-- uses: actions/cache@v3.0.8
+- uses: actions/cache@v3.0.10
   with:
 path: ~/.m2/repository
 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 68f6f69..fa80dfa 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -32,7 +32,7 @@ jobs:
 - uses: actions/checkout@v3.0.2
   with:
 persist-credentials: false
-- uses: actions/cache@v3.0.8
+- uses: actions/cache@v3.0.10
   with:
 path: ~/.m2/repository
 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index d4354f3..23406aa 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -37,7 +37,7 @@ jobs:
 - uses: actions/checkout@v3.0.2
   with:
 persist-credentials: false
-- uses: actions/cache@v3.0.8
+- uses: actions/cache@v3.0.10
   with:
 path: ~/.m2/repository
 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}



[commons-fileupload] branch master updated: Bump ossf/scorecard-action from 1.1.2 to 2.0.4 (#168)

2022-09-28 Thread jochen
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 39b2a8e  Bump ossf/scorecard-action from 1.1.2 to 2.0.4 (#168)
39b2a8e is described below

commit 39b2a8e36e929466967750f2bfe67fe8b281a31a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Sep 28 21:00:38 2022 +0200

Bump ossf/scorecard-action from 1.1.2 to 2.0.4 (#168)

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) 
from 1.1.2 to 2.0.4.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- 
[Commits](https://github.com/ossf/scorecard-action/compare/ce330fde6b1a5c9c75b417e7efc510b822a35564...e363bfca00e752f91de7b7d2a77340e2e523cb18)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] 

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 .github/workflows/scorecards-analysis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/scorecards-analysis.yml 
b/.github/workflows/scorecards-analysis.yml
index abd6992..5516cda 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -43,7 +43,7 @@ jobs:
   persist-credentials: false
 
   - name: "Run analysis"
-uses: ossf/scorecard-action@ce330fde6b1a5c9c75b417e7efc510b822a35564   
 # 1.1.2
+uses: ossf/scorecard-action@e363bfca00e752f91de7b7d2a77340e2e523cb18   
 # 1.1.2
 with:
   results_file: results.sarif
   results_format: sarif



[commons-crypto] branch master updated: Undoing accidental white space changes.

2022-06-10 Thread jochen
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-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new de6d7aa  Undoing accidental white space changes.
de6d7aa is described below

commit de6d7aaa0f7d499635fe7ca3978691b7e6790697
Author: Jochen Wiedmann 
AuthorDate: Fri Jun 10 10:38:48 2022 +0200

Undoing accidental white space changes.
---
 src/changes/changes.xml | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 9643f85..bd45924 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -70,25 +70,28 @@
   Port from pre-Java 8 javah tool to Java 8 and up javac with the -h 
option.
   Fix build on Java 11.
   Fix build on Java 17.
+  
+  Add github/codeql-action 2 #159.
   
+  Bump actions/cache from 2.1.7 to 3.0.4 
#150.
   Bump actions/checkout from 2 to 3 #149.
-  Bump actions/cache from 2.1.7 to 3.0.3 
#150.
   Bump actions/setup-java from 2 to 3.
-  Update commons.jacoco.version 0.8.5 to 0.8.7 (Fixes Java 15 
builds).
   Minor 
improvement #115, #125.
   Migrate 
to Junit 5 #114.
   Bump jna from 5.5.0 to 5.11.0 #123, #139, #153.
-  Update commons.japicmp.version 0.14.3 -> 0.15.7.
+  Bump commons.japicmp.version from 0.14.3 to 0.15.7.
   Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2 
#130.
-  Bump jmh.version from 1.12 to 1.34 #119.
+  Bump jmh.version from 1.12 to 1.35 #119, #157.
   Bump exec-maven-plugin from 1.6.0 to 3.0.0 #121.
-  Bump maven-antrun-plugin from 1.8 to 3.0.0 #120.
-  Bump commons.japicmp.version 0.15.2 -> 0.15.7 #138.
-  Bump jacoco-maven-plugin 0.6.6 -> 0.8.8 #138, #154.
-  Bump commons.javadoc.version 3.2.0 -> 3.3.2 #138.
+  Bump maven-antrun-plugin from 1.8 to 3.1.0 #120, 
#158.
+  Bump commons.japicmp.version from 0.15.2 to 0.15.7 #138.
+  Bump jacoco-maven-plugin from 0.6.6 to 0.8.8 #138, #154.
+  Bump commons.javadoc.version from 3.2.0 to 3.4.0 #138.
   Bump maven-pmd-plugin from 3.14.0 to 3.16.0 #140.
   Bump taglist-maven-plugin from 2.4 to 3.0.0 #147.
-  Bump spotbugs-maven-plugin from 4.5.3.0 to 4.6.0.0 
#152.
+  Bump spotbugs-maven-plugin from 4.5.3.0 to 4.7.0.0 #152, 
#160.
+  Bump commons-parent from 52 to 53.
+  Bump commons.surefire.version from 3.0.0-M5 to 3.0.0-M7.
 
 
   Support Galois/Counter Mode 
(GCM).



[commons-crypto] branch master updated: CRYPTO-160: Improve quality for methods, that JavaCryptoRandom inherits from Random.

2022-06-10 Thread jochen
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-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new fcdb396  CRYPTO-160: Improve quality for methods, that 
JavaCryptoRandom inherits from Random.
fcdb396 is described below

commit fcdb39680498b7959567e8edbc4f970108d014d9
Author: Jochen Wiedmann 
AuthorDate: Fri Jun 10 10:25:46 2022 +0200

CRYPTO-160: Improve quality for methods, that JavaCryptoRandom inherits 
from Random.
---
 pom.xml|  2 +-
 src/changes/changes.xml| 22 ++---
 .../commons/crypto/random/JavaCryptoRandom.java| 20 +++
 .../crypto/random/JavaCryptoRandomTest.java| 23 +-
 4 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/pom.xml b/pom.xml
index 29bf1df..53a2d16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -585,7 +585,7 @@ The following provides more details on the included 
cryptographic software:
   run
 
 
-  
+  
 
 
   
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e99c571..9643f85 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -62,6 +62,7 @@
 
   
 
+  Enhance the quality 
of JavaCryptoRandom as a subclass of Random by overwriting 
Random.next(inz).
   
   License header should be plain a 
comment #113.
   Fix PMD warning and don't init to defaults #128.
@@ -69,28 +70,25 @@
   Port from pre-Java 8 javah tool to Java 8 and up javac with the -h 
option.
   Fix build on Java 11.
   Fix build on Java 17.
-  
-  Add github/codeql-action 2 #159.
   
-  Bump actions/cache from 2.1.7 to 3.0.4 
#150.
   Bump actions/checkout from 2 to 3 #149.
+  Bump actions/cache from 2.1.7 to 3.0.3 
#150.
   Bump actions/setup-java from 2 to 3.
+  Update commons.jacoco.version 0.8.5 to 0.8.7 (Fixes Java 15 
builds).
   Minor 
improvement #115, #125.
   Migrate 
to Junit 5 #114.
   Bump jna from 5.5.0 to 5.11.0 #123, #139, #153.
-  Bump commons.japicmp.version from 0.14.3 to 0.15.7.
+  Update commons.japicmp.version 0.14.3 -> 0.15.7.
   Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2 
#130.
-  Bump jmh.version from 1.12 to 1.35 #119, #157.
+  Bump jmh.version from 1.12 to 1.34 #119.
   Bump exec-maven-plugin from 1.6.0 to 3.0.0 #121.
-  Bump maven-antrun-plugin from 1.8 to 3.1.0 #120, 
#158.
-  Bump commons.japicmp.version from 0.15.2 to 0.15.7 #138.
-  Bump jacoco-maven-plugin from 0.6.6 to 0.8.8 #138, #154.
-  Bump commons.javadoc.version from 3.2.0 to 3.4.0 #138.
+  Bump maven-antrun-plugin from 1.8 to 3.0.0 #120.
+  Bump commons.japicmp.version 0.15.2 -> 0.15.7 #138.
+  Bump jacoco-maven-plugin 0.6.6 -> 0.8.8 #138, #154.
+  Bump commons.javadoc.version 3.2.0 -> 3.3.2 #138.
   Bump maven-pmd-plugin from 3.14.0 to 3.16.0 #140.
   Bump taglist-maven-plugin from 2.4 to 3.0.0 #147.
-  Bump spotbugs-maven-plugin from 4.5.3.0 to 4.7.0.0 #152, 
#160.
-  Bump commons-parent from 52 to 53.
-  Bump commons.surefire.version from 3.0.0-M5 to 3.0.0-M7.
+  Bump spotbugs-maven-plugin from 4.5.3.0 to 4.6.0.0 
#152.
 
 
   Support Galois/Counter Mode 
(GCM).
diff --git 
a/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java 
b/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java
index 519eb65..5e65cea 100644
--- a/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java
+++ b/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java
@@ -22,6 +22,8 @@ import java.security.SecureRandom;
 import java.util.Properties;
 import java.util.Random;
 
+import org.apache.commons.crypto.utils.Utils;
+
 /**
  * A CryptoRandom of Java implementation.
  */
@@ -76,4 +78,22 @@ class JavaCryptoRandom extends Random implements 
CryptoRandom {
 public void nextBytes(final byte[] bytes) {
 instance.nextBytes(bytes);
 }
+
+/**
+ * Overrides Random#next(). Generates an integer containing the
+ * user-specified number of random bits(right justified, with leading
+ * zeros).
+ *
+ * @param numBits number of random bits to be generated, where 0
+ *{@literal <=} {@code numBits} {@literal <=} 32.
+ * @return int an {@code int} containing the user-specified number of
+ * random bits (right justified, with leading zeros).
+ */
+@Override
+protected int next(final int numBits) {
+Utils.checkArgument(numBits >= 0 && numBits <= 32);
+   // Can't simply invoke instance.next(bits) here, because that 
is package protected.
+   // But, this s

[commons-fileupload] branch master updated (c913836 -> 7235057)

2022-06-08 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from c913836  Bump actions/cache from 3.0.3 to 3.0.4
 add 7235057  Bump biz.aQute.bndlib from 6.3.0 to 6.3.1 (#151)

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[commons-lang] branch master updated (4f08422f7 -> 6d8dfbe6a)

2022-06-07 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 4f08422f7 Bump commons.pmd-impl.version from 6.45.0 to 6.46.0
 new a6e18d946 Increase test coverage of functional interfaces
 new 3e66c1de1 Move tests into FailableFunctionsTest
 new 6d8dfbe6a Merge pull request #907 from 
stevebosman-oc/feature/functionCodeCoverage

The 6770 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../lang3/function/FailableFunctionsTest.java  | 115 +
 1 file changed, 115 insertions(+)



[commons-fileupload] branch master updated: Bump biz.aQute.bndlib from 6.2.0 to 6.3.0 (#149)

2022-06-07 Thread jochen
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 f84364d  Bump biz.aQute.bndlib from 6.2.0 to 6.3.0 (#149)
f84364d is described below

commit f84364d38deeff2a9fc9d48c07fb5fa79af1f2e7
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Tue Jun 7 11:38:14 2022 +0200

Bump biz.aQute.bndlib from 6.2.0 to 6.3.0 (#149)

Bumps [biz.aQute.bndlib](https://github.com/bndtools/bnd) from 6.2.0 to 
6.3.0.
- [Release notes](https://github.com/bndtools/bnd/releases)
- 
[Changelog](https://github.com/bndtools/bnd/blob/master/docs/ADDING_RELEASE_DOCS.md)
- [Commits](https://github.com/bndtools/bnd/compare/6.2.0...6.3.0)

---
updated-dependencies:
- dependency-name: biz.aQute.bnd:biz.aQute.bndlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 3e8c53e..97af87e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -333,7 +333,7 @@
   
 biz.aQute.bnd
 biz.aQute.bndlib
-6.2.0
+6.3.0
   
 
   



[commons-fileupload] branch master updated: Bump maven-pmd-plugin from 3.16.0 to 3.17.0 (#150)

2022-06-07 Thread jochen
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 6ad3e1f  Bump maven-pmd-plugin from 3.16.0 to 3.17.0 (#150)
6ad3e1f is described below

commit 6ad3e1f04baa03acc08c652bc557bd27ceb92caf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Tue Jun 7 11:33:18 2022 +0200

Bump maven-pmd-plugin from 3.16.0 to 3.17.0 (#150)

Bumps [maven-pmd-plugin](https://github.com/apache/maven-pmd-plugin) from 
3.16.0 to 3.17.0.
- [Release notes](https://github.com/apache/maven-pmd-plugin/releases)
- 
[Commits](https://github.com/apache/maven-pmd-plugin/compare/maven-pmd-plugin-3.16.0...maven-pmd-plugin-3.17.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-pmd-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 98b9f05..3e8c53e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -472,7 +472,7 @@
   
 org.apache.maven.plugins
 maven-pmd-plugin
-3.16.0
+3.17.0
 
   ${maven.compiler.target}
   



[commons-crypto] branch master updated: Suggesting build with Docker.

2022-05-18 Thread jochen
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-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new 6e8cebe  Suggesting build with Docker.
6e8cebe is described below

commit 6e8cebe7a856c83f5b8c020860c40f4d627bedea
Author: Jochen Wiedmann 
AuthorDate: Wed May 18 17:06:13 2022 +0200

Suggesting build with Docker.
---
 src/docker/Dockerfile | 26 ++
 src/docker/README.md  |  5 +
 2 files changed, 31 insertions(+)

diff --git a/src/docker/Dockerfile b/src/docker/Dockerfile
new file mode 100644
index 000..e03c836
--- /dev/null
+++ b/src/docker/Dockerfile
@@ -0,0 +1,26 @@
+FROM ubuntu:bionic-20220401
+RUN dpkg --add-architecture i386
+RUN apt update
+RUN apt-get -y install gcc
+RUN apt-get -y install g++
+RUN apt-get -y install make
+RUN apt-get -y install wget curl
+RUN apt-get -y install git
+RUN apt-get -y install openjdk-8-jdk
+RUN apt-get -y -oDebug::pkgAcquire::Worker=1 install openjdk-11-jdk 
+RUN apt-get install -y mingw-w64
+# This package is documented in BUILDING.txt, but doesn't appear to be 
available.
+# RUN apt-get install -y x86_64-w64-mingw32-gcc
+RUN apt-get install -y gcc-mingw-w64-i686
+RUN apt-get install -y libssl-dev:i386 libssl-dev
+RUN apt-get install -y g++-multilib
+RUN mkdir -p /usr/local/build
+WORKDIR /usr/local/build
+RUN wget 
https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz
+RUN tar xzf apache-maven-3.8.5-bin.tar.gz
+RUN ln -s ../build/apache-maven-3.8.5/bin/mvn /usr/local/bin
+RUN git clone https://gitbox.apache.org/repos/asf/commons-crypto.git 
commons-crypto
+WORKDIR /usr/local/build/commons-crypto
+RUN VERSION=1.1.1-SNAPSHOT JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 make
+RUN mvn
+CMD bash
diff --git a/src/docker/README.md b/src/docker/README.md
new file mode 100644
index 000..b8d2030
--- /dev/null
+++ b/src/docker/README.md
@@ -0,0 +1,5 @@
+# Building with Docker
+
+```
+  docker image build -t apache/commons-crypto:
+```



[commons-fileupload] branch master updated: Bump spotbugs from 4.5.3 to 4.6.0 (#139)

2022-03-09 Thread jochen
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 4741472  Bump spotbugs from 4.5.3 to 4.6.0 (#139)
4741472 is described below

commit 47414723191ddf118118080cc0306778a7778458
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Mar 9 14:54:35 2022 +0100

Bump spotbugs from 4.5.3 to 4.6.0 (#139)

Bumps [spotbugs](https://github.com/spotbugs/spotbugs) from 4.5.3 to 4.6.0.
- [Release notes](https://github.com/spotbugs/spotbugs/releases)
- [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spotbugs/spotbugs/compare/4.5.3...4.6.0)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1eebede..e77d443 100644
--- a/pom.xml
+++ b/pom.xml
@@ -248,7 +248,7 @@
 Rob Tompkins
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
 4.5.3.0
-4.5.3
+4.6.0
 3.1.2
 
   


[commons-fileupload] branch master updated: Bump actions/checkout from 2 to 3 (#138)

2022-03-02 Thread jochen
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 04f75f6  Bump actions/checkout from 2 to 3 (#138)
04f75f6 is described below

commit 04f75f6779ef9c51dfa9faa065a814b7b32b1981
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Mar 2 09:54:43 2022 +0100

Bump actions/checkout from 2 to 3 (#138)

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 .github/workflows/codeql-analysis.yml | 2 +-
 .github/workflows/maven.yml   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/codeql-analysis.yml 
b/.github/workflows/codeql-analysis.yml
index 1cb1616..2bf1120 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -42,7 +42,7 @@ jobs:
 
 steps:
 - name: Checkout repository
-  uses: actions/checkout@v2
+  uses: actions/checkout@v3
 
 # Initializes the CodeQL tools for scanning.
 - name: Initialize CodeQL
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index a243698..1c0a80d 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -31,7 +31,7 @@ jobs:
 #experimental: true
 
 steps:
-- uses: actions/checkout@v2.4.0
+- uses: actions/checkout@v3
 - uses: actions/cache@v2.1.7
   with:
 path: ~/.m2/repository


[commons-fileupload] branch master updated (2241aeb -> 4b9f3d4)

2022-01-08 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 2241aeb  Bump spotbugs-maven-plugin from 4.4.2.1 to 4.5.0.0 (#127)
 add 4b9f3d4  Bump spotbugs from 4.5.2 to 4.5.3 (#134)

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated (55f485d -> 3d8bfa0)

2021-11-18 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 55f485d  Bump spotbugs-maven-plugin from 4.4.1 to 4.4.2.1 (#123)
 add 3d8bfa0  Bump spotbugs from 4.4.1 to 4.5.0 (#126)

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated: Bump spotbugs-maven-plugin from 4.4.1 to 4.4.2.1 (#123)

2021-10-19 Thread jochen
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 55f485d  Bump spotbugs-maven-plugin from 4.4.1 to 4.4.2.1 (#123)
55f485d is described below

commit 55f485d8436578a3f0b89a753043311e93b3849a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Tue Oct 19 09:40:38 2021 +0200

Bump spotbugs-maven-plugin from 4.4.1 to 4.4.2.1 (#123)

Bumps 
[spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 
4.4.1 to 4.4.2.1.
- [Release 
notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- 
[Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.4.1...spotbugs-maven-plugin-4.4.2.1)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 0b7628d..edff8af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -247,7 +247,7 @@
 
scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}
 Rob Tompkins
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
-4.4.1
+4.4.2.1
 4.4.1
 3.1.2
 


[commons-compress] branch master updated: Use Boolean constants instead of Boolean.valueOf

2021-10-12 Thread jochen
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-compress.git


The following commit(s) were added to refs/heads/master by this push:
 new acb980b  Use Boolean constants instead of Boolean.valueOf
 new 757c229  Merge pull request #225 from stefanbirkner/boolean
acb980b is described below

commit acb980bcb4b39607abc22860d7eb6fc2ecbeef60
Author: Stefan Birkner 
AuthorDate: Tue Oct 12 19:07:19 2021 +0200

Use Boolean constants instead of Boolean.valueOf

Boolean.TRUE and Boolean.FALSE are shorter and easier to read. It also
fixes a PMD violation.
---
 .../java/org/apache/commons/compress/harmony/unpack200/BcBands.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/BcBands.java 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/BcBands.java
index d091a23..fbab072 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/BcBands.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/BcBands.java
@@ -189,12 +189,12 @@ public class BcBands extends BandSet {
 bcLabelCount++;
 break;
 case 170: // tableswitch
-switchIsTableSwitch.add(Boolean.valueOf(true));
+switchIsTableSwitch.add(Boolean.TRUE);
 bcCaseCountCount++;
 bcLabelCount++;
 break;
 case 171: // lookupswitch
-switchIsTableSwitch.add(Boolean.valueOf(false));
+switchIsTableSwitch.add(Boolean.FALSE);
 bcCaseCountCount++;
 bcLabelCount++;
 break;


[commons-fileupload] branch master updated: Bump moditect-maven-plugin from 1.0.0.RC1 to 1.0.0.RC2 (#118)

2021-10-08 Thread jochen
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 19a702b  Bump moditect-maven-plugin from 1.0.0.RC1 to 1.0.0.RC2 (#118)
19a702b is described below

commit 19a702b155008dd146a0c5848754f544242cea9f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 8 16:39:38 2021 +0200

Bump moditect-maven-plugin from 1.0.0.RC1 to 1.0.0.RC2 (#118)

Bumps [moditect-maven-plugin](https://github.com/moditect/moditect) from 
1.0.0.RC1 to 1.0.0.RC2.
- [Release notes](https://github.com/moditect/moditect/releases)
- 
[Commits](https://github.com/moditect/moditect/compare/1.0.0.RC1...1.0.0.CR2)

---
updated-dependencies:
- dependency-name: org.moditect:moditect-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b626d2d..0b7628d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -237,7 +237,7 @@
 javax.portlet
 0.15.3
 true
-1.0.0.RC1
+1.0.0.RC2
 true
 
 


[commons-fileupload] branch master updated (5907684 -> 5bb1713)

2021-10-08 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 5907684  Update GitHub build from Java 16 to 17.
 add 5bb1713  Bump biz.aQute.bndlib from 5.2.0 to 6.0.0 (#119)

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated: Bump junit-jupiter from 5.8.0 to 5.8.1 (#117)

2021-09-27 Thread jochen
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 e056f60  Bump junit-jupiter from 5.8.0 to 5.8.1 (#117)
e056f60 is described below

commit e056f603610e64694e19c69670c4598afaf9d1ab
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Mon Sep 27 21:39:01 2021 +0200

Bump junit-jupiter from 5.8.0 to 5.8.1 (#117)

Bumps [junit-jupiter](https://github.com/junit-team/junit5) from 5.8.0 to 
5.8.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.8.0...r5.8.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 795bf69..fc61702 100644
--- a/pom.xml
+++ b/pom.xml
@@ -257,7 +257,7 @@
 
   org.junit.jupiter
   junit-jupiter
-  5.8.0
+  5.8.1
   test
 
 


[commons-fileupload] branch master updated: Bump spotbugs-maven-plugin from 4.3.0 to 4.4.1 (#115)

2021-09-25 Thread jochen
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 12daad5  Bump spotbugs-maven-plugin from 4.3.0 to 4.4.1 (#115)
12daad5 is described below

commit 12daad5f95cf8c01dbd1e870f24db796b6bc8ce7
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Sat Sep 25 19:29:49 2021 +0200

Bump spotbugs-maven-plugin from 4.3.0 to 4.4.1 (#115)

Bumps 
[spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 
4.3.0 to 4.4.1.
- [Release 
notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- 
[Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.3.0...spotbugs-maven-plugin-4.4.1)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b52d5a5..795bf69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -247,7 +247,7 @@
 
scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}
 Rob Tompkins
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
-4.3.0
+4.4.1
 4.4.1
 3.1.2
 


[commons-fileupload] branch master updated: Improve Travis CI build Performance (#106)

2021-09-25 Thread jochen
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 7c0a9e9  Improve Travis CI build Performance (#106)
7c0a9e9 is described below

commit 7c0a9e9d1a024d64d4ef6e7a65e046209393c1e3
Author: YunLemon <340355...@qq.com>
AuthorDate: Sun Sep 26 01:29:37 2021 +0800

Improve Travis CI build Performance (#106)
---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.travis.yml b/.travis.yml
index d525af2..753fb38 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,7 @@ cache:
   directories:
 - $HOME/.m2
 matrix:
+  fast_finish: true
   include:
 - jdk: openjdk8
 - jdk: openjdk11


[commons-fileupload] branch master updated: Bump junit-jupiter from 5.7.2 to 5.8.0 (#113)

2021-09-25 Thread jochen
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 6ab3f7a  Bump junit-jupiter from 5.7.2 to 5.8.0 (#113)
6ab3f7a is described below

commit 6ab3f7a9e0aa577e2f2cb7708bdeb5c3149fec2b
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Sat Sep 25 19:29:06 2021 +0200

Bump junit-jupiter from 5.7.2 to 5.8.0 (#113)

Bumps [junit-jupiter](https://github.com/junit-team/junit5) from 5.7.2 to 
5.8.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.7.2...r5.8.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e145b2d..b52d5a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -257,7 +257,7 @@
 
   org.junit.jupiter
   junit-jupiter
-  5.7.2
+  5.8.0
   test
 
 


[commons-fileupload] branch master updated: Remove unnecessary boxing (#116)

2021-09-25 Thread jochen
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 a8499b3  Remove unnecessary boxing (#116)
a8499b3 is described below

commit a8499b3c5d8e0740c263845e2a74d9b6ae5262e8
Author: Arturo Bernal 
AuthorDate: Sat Sep 25 19:28:43 2021 +0200

Remove unnecessary boxing (#116)
---
 src/main/java/org/apache/commons/fileupload2/MultipartStream.java | 2 +-
 src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java   | 4 ++--
 .../org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java | 4 ++--
 .../java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java  | 4 ++--
 .../apache/commons/fileupload2/jaksrvlt/JakSrvltRequestContext.java   | 2 +-
 .../org/apache/commons/fileupload2/portlet/PortletRequestContext.java | 2 +-
 .../org/apache/commons/fileupload2/servlet/ServletRequestContext.java | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/MultipartStream.java 
b/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
index 7621774..0584466 100644
--- a/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
+++ b/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
@@ -572,7 +572,7 @@ public class MultipartStream {
 if (++size > HEADER_PART_SIZE_MAX) {
 throw new MalformedStreamException(
 format("Header section has more than %s bytes (maybe 
it is not properly terminated)",
-   Integer.valueOf(HEADER_PART_SIZE_MAX)));
+HEADER_PART_SIZE_MAX));
 }
 if (b == HEADER_SEPARATOR[i]) {
 i++;
diff --git 
a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java 
b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
index 348d360..923daa6 100644
--- a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
@@ -599,8 +599,8 @@ public class DiskFileItem
 @Override
 public String toString() {
 return format("name=%s, StoreLocation=%s, size=%s bytes, 
isFormField=%s, FieldName=%s",
-  getName(), getStoreLocation(), Long.valueOf(getSize()),
-  Boolean.valueOf(isFormField()), getFieldName());
+  getName(), getStoreLocation(), getSize(),
+isFormField(), getFieldName());
 }
 
 /**
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 9a1a0f5..7783630 100644
--- 
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
+++ 
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
@@ -168,7 +168,7 @@ public class FileItemIteratorImpl implements 
FileItemIterator {
 if (requestSize != -1 && requestSize > sizeMax) {
 throw new SizeLimitExceededException(
 format("the request was rejected because its size (%s) 
exceeds the configured maximum (%s)",
-Long.valueOf(requestSize), Long.valueOf(sizeMax)),
+requestSize, sizeMax),
requestSize, sizeMax);
 }
 // N.B. this is eventually closed in MultipartStream processing
@@ -178,7 +178,7 @@ public class FileItemIteratorImpl implements 
FileItemIterator {
 throws IOException {
 final FileUploadException ex = new 
SizeLimitExceededException(
 format("the request was rejected because its size (%s) 
exceeds the configured maximum (%s)",
-Long.valueOf(pCount), Long.valueOf(pSizeMax)),
+pCount, pSizeMax),
pCount, pSizeMax);
 throw new FileUploadIOException(ex);
 }
diff --git 
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java 
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
index 2d36b52..6bae29a 100644
--- a/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
+++ b/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
@@ -101,7 +101,7 @@ public class FileItemStreamImpl implements FileItemStream {
 final FileSizeLimitExceededException e =
 new FileSizeLimitExceededException(
 format("The field %s exceeds its maximum permitted 
size of %s bytes.",
-   

[commons-fileupload] branch master updated (1deeae4 -> 538410d)

2021-09-19 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 1deeae4  Bump maven-pmd-plugin from 3.14.0 to 3.15.0 (#110)
 add 538410d  FILEUPLOAD-344 - Check final variable checkstyle. (#114)

No new revisions were added by this update.

Summary of changes:
 pom.xml| 22 ++
 src/checkstyle/fileupload_checks.xml   |  6 +-
 .../apache/commons/fileupload2/FileUploadBase.java |  4 ++--
 .../commons/fileupload2/MultipartStream.java   |  2 +-
 .../commons/fileupload2/disk/DiskFileItem.java |  8 
 .../fileupload2/util/FileItemHeadersImpl.java  |  3 ++-
 6 files changed, 36 insertions(+), 9 deletions(-)


[commons-io] branch master updated (f1d9aa9 -> c146a94)

2021-09-17 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from f1d9aa9  Javadoc.
 new 414979f  IO-747 Make commons-io a proper JPMS module
 new 7854f80  IO-747 Change the name of the JPMS module
 new 6c97a6d  IO-747 Enable moditect plugin when building with Java 9+
 new c146a94  Merge pull request #268 from 
martin-g/io-747-make-commons-io-proper-jpms-module

The 3281 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 68 ++---
 src/changes/changes.xml |  3 +++
 2 files changed, 68 insertions(+), 3 deletions(-)


[commons-fileupload] branch master updated: Bump maven-pmd-plugin from 3.14.0 to 3.15.0 (#110)

2021-09-13 Thread jochen
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 1deeae4  Bump maven-pmd-plugin from 3.14.0 to 3.15.0 (#110)
1deeae4 is described below

commit 1deeae4bb01d12da99ce377be142c0e5d1bf7c5b
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Mon Sep 13 14:45:32 2021 +0200

Bump maven-pmd-plugin from 3.14.0 to 3.15.0 (#110)

Bumps [maven-pmd-plugin](https://github.com/apache/maven-pmd-plugin) from 
3.14.0 to 3.15.0.
- [Release notes](https://github.com/apache/maven-pmd-plugin/releases)
- 
[Commits](https://github.com/apache/maven-pmd-plugin/compare/maven-pmd-plugin-3.14.0...maven-pmd-plugin-3.15.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-pmd-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c5a4b90..4378374 100644
--- a/pom.xml
+++ b/pom.xml
@@ -450,7 +450,7 @@
   
 org.apache.maven.plugins
 maven-pmd-plugin
-3.14.0
+3.15.0
 
   ${maven.compiler.target}
   


[commons-fileupload] branch master updated: Bump spotbugs from 4.4.0 to 4.4.1 (#111)

2021-09-13 Thread jochen
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 2560998  Bump spotbugs from 4.4.0 to 4.4.1 (#111)
2560998 is described below

commit 2560998620210e11bf9c7237ed64fad4809539ec
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Mon Sep 13 14:45:07 2021 +0200

Bump spotbugs from 4.4.0 to 4.4.1 (#111)

Bumps [spotbugs](https://github.com/spotbugs/spotbugs) from 4.4.0 to 4.4.1.
- [Release notes](https://github.com/spotbugs/spotbugs/releases)
- [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spotbugs/spotbugs/compare/4.4.0...4.4.1)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] 

Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9e2eb8f..c5a4b90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -248,7 +248,7 @@
 Rob Tompkins
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
 4.3.0
-4.4.0
+4.4.1
 3.1.2
 
   


[commons-fileupload] branch master updated: FILEUPLOAD-342 Remove methods which use javax|jakarta classes from FileUploadBase (#109)

2021-09-13 Thread jochen
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 18db2b7  FILEUPLOAD-342 Remove methods which use javax|jakarta classes 
from FileUploadBase (#109)
18db2b7 is described below

commit 18db2b7e5a471b5bd81dab119db43c9efceda3cf
Author: Martin Grigorov 
AuthorDate: Mon Sep 13 15:44:34 2021 +0300

FILEUPLOAD-342 Remove methods which use javax|jakarta classes from 
FileUploadBase (#109)

* FILEUPLOAD-342 Remove methods which use javax|jakarta classes from 
FileUploadBase

It should be neutral.

* FILEUPLOAD-342 Remove all deprecated classes and their tests
---
 .../commons/fileupload2/DefaultFileItem.java   |  71 -
 .../fileupload2/DefaultFileItemFactory.java| 104 --
 .../apache/commons/fileupload2/DiskFileUpload.java | 200 
 .../apache/commons/fileupload2/FileUploadBase.java |  40 ---
 .../fileupload2/pub/UnknownSizeException.java  |  55 
 .../fileupload2/servlet/ServletFileUpload.java |   1 -
 .../commons/fileupload2/DefaultFileItemTest.java   | 355 -
 .../commons/fileupload2/DiskFileUploadTest.java| 100 --
 8 files changed, 926 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/DefaultFileItem.java 
b/src/main/java/org/apache/commons/fileupload2/DefaultFileItem.java
deleted file mode 100644
index 3e55865..000
--- a/src/main/java/org/apache/commons/fileupload2/DefaultFileItem.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.fileupload2;
-
-import java.io.File;
-
-import org.apache.commons.fileupload2.disk.DiskFileItem;
-
-/**
- *  The default implementation of the
- * {@link org.apache.commons.fileupload2.FileItem FileItem} interface.
- *
- *  After retrieving an instance of this class from a {@link
- * org.apache.commons.fileupload2.DiskFileUpload DiskFileUpload} instance (see
- * {@link org.apache.commons.fileupload2.DiskFileUpload
- * #parseRequest(javax.servlet.http.HttpServletRequest)}), you may
- * either request all contents of file at once using {@link #get()} or
- * request an {@link java.io.InputStream InputStream} with
- * {@link #getInputStream()} and process the file without attempting to load
- * it into memory, which may come handy with large files.
- *
- * @deprecated 1.1 Use {@code DiskFileItem} instead.
- */
-@Deprecated
-public class DefaultFileItem
-extends DiskFileItem {
-
-// --- Constructors
-
-/**
- * Constructs a new {@code DefaultFileItem} instance.
- *
- * @param fieldName The name of the form field.
- * @param contentType   The content type passed by the browser or
- *  {@code null} if not specified.
- * @param isFormField   Whether or not this item is a plain form field, as
- *  opposed to a file upload.
- * @param fileName  The original file name in the user's file system, 
or
- *  {@code null} if not specified.
- * @param sizeThreshold The threshold, in bytes, below which items will be
- *  retained in memory and above which they will be
- *  stored as a file.
- * @param repositoryThe data repository, which is the directory in
- *  which files will be created, should the item size
- *  exceed the threshold.
- *
- * @deprecated 1.1 Use {@code DiskFileItem} instead.
- */
-@Deprecated
-public DefaultFileItem(final String fieldName, final String contentType,
-final boolean isFormField, final String fileName, final int 
sizeThreshold,
-final File repository) {
-super(fieldName, contentType, isFormField, fileName, sizeThreshold,
-repository);
-}
-
-}
diff --git 
a/src/main/java/org/apache/commons/fileupload2/DefaultFileItemFactory.java 
b/src/main/java/org/apache

[commons-fileupload] branch master updated: FILEUPLOAD-341 Add a section the the migration guide (#108)

2021-09-13 Thread jochen
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 e90f744  FILEUPLOAD-341 Add a section the the migration guide (#108)
e90f744 is described below

commit e90f744bf1f9ffb92db858dc104be86fdbd9c420
Author: Martin Grigorov 
AuthorDate: Mon Sep 13 15:42:59 2021 +0300

FILEUPLOAD-341 Add a section the the migration guide (#108)
---
 src/changes/changes.xml   | 2 +-
 src/site/apt/migration.apt.vm | 8 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5b15bf3..a9ee291 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -58,7 +58,7 @@ The  type attribute can be add,update,fix,remove.
   Update commons.japicmp.version 0.13.0 -> 0.15.3.
   Bump build actions/setup-java from v1.4.3 to v2.
   Bump spotbugs-maven-plugin from 4.2.3 to 4.3.0 
#103.
-  FILEUPLOAD-340 Make commons-fileupload2 a JPMS module by adding 
module-info.class.
+  Make 
commons-fileupload2 a JPMS module by adding module-info.class.
   Update Spotbugs from 4.2.3 to 4.4.0, ignore EI_EXPOSE_REP, 
and EI_EXPOSE_REP2.
   Move Exception classes out of the impl package.
 
diff --git a/src/site/apt/migration.apt.vm b/src/site/apt/migration.apt.vm
index d362496..4a9ad04 100644
--- a/src/site/apt/migration.apt.vm
+++ b/src/site/apt/migration.apt.vm
@@ -25,7 +25,7 @@ Migration
 
 # Migrating to Commons FileUpload 2
 
-   Commons Fileupload is the first version, that drops compatibility to 
previous versions. This means, that
+   Commons Fileupload 2 is the first version, that drops compatibility to 
previous versions. This means, that
you need to adapt your projects as follows:
 
1. Upgrade your Java version to 8, or later.
@@ -132,3 +132,9 @@ The following example demonstrates, how to use Commons 
Fileupload with the Java
 }
 
 +---
+
+# Commons FileUpload 2 can be used a Java Package Module
+
+The library provides <> that defines the 
required modules and exported packages.
+All packages but <> are exported. All 
exception classes have been moved from
+<> to 
<> package


[commons-fileupload] branch master updated: FILEUPLOAD-340 Give a better name for the JPMS module (#112)

2021-09-13 Thread jochen
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 7b0c563  FILEUPLOAD-340 Give a better name for the JPMS module (#112)
7b0c563 is described below

commit 7b0c5633968d2f9e75257d24efe916800c9050a0
Author: Martin Grigorov 
AuthorDate: Mon Sep 13 15:42:07 2021 +0300

FILEUPLOAD-340 Give a better name for the JPMS module (#112)

Set javac's --release to 8 when releasing
---
 pom.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 927f435..9e2eb8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -332,7 +332,7 @@
   true
   
 
-  commons.fileupload2
+  org.apache.commons.fileupload2
   
 !org.apache.commons.fileupload2.impl;
 *;
@@ -593,6 +593,7 @@
   release
   
 false
+8
   
 
   


[commons-fileupload] branch master updated: PR: FILEUPLOAD-341 Move Exception classes out of impl

2021-08-20 Thread jochen
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 8fa525d  PR: FILEUPLOAD-341 Move Exception classes out of impl
8fa525d is described below

commit 8fa525dd420dcfcec0341a445b0d06c811731d99
Author: Jochen Wiedmann 
AuthorDate: Fri Aug 20 10:42:51 2021 +0200

PR: FILEUPLOAD-341 Move Exception classes out of impl
---
 src/changes/changes.xml|  1 +
 .../commons/fileupload2/FileItemIterator.java  |  4 ++--
 .../apache/commons/fileupload2/FileUploadBase.java |  4 ++--
 .../commons/fileupload2/MultipartStream.java   |  2 +-
 .../fileupload2/impl/FileItemIteratorImpl.java |  3 +++
 .../fileupload2/impl/FileItemStreamImpl.java   |  2 ++
 .../FileSizeLimitExceededException.java|  2 +-
 .../{impl => pub}/FileUploadIOException.java   |  2 +-
 .../{impl => pub}/IOFileUploadException.java   |  2 +-
 .../{impl => pub}/InvalidContentTypeException.java |  2 +-
 .../fileupload2/{impl => pub}/SizeException.java   |  2 +-
 .../{impl => pub}/SizeLimitExceededException.java  |  2 +-
 .../{impl => pub}/UnknownSizeException.java|  2 +-
 .../commons/fileupload2/pub/package-info.java  | 22 ++
 .../commons/fileupload2/DiskFileUploadTest.java|  2 +-
 .../org/apache/commons/fileupload2/SizesTest.java  |  6 +++---
 .../apache/commons/fileupload2/StreamingTest.java  |  2 +-
 17 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 9d1cbbc..5b15bf3 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -60,6 +60,7 @@ The  type attribute can be add,update,fix,remove.
   Bump spotbugs-maven-plugin from 4.2.3 to 4.3.0 
#103.
   FILEUPLOAD-340 Make commons-fileupload2 a JPMS module by adding 
module-info.class.
   Update Spotbugs from 4.2.3 to 4.4.0, ignore EI_EXPOSE_REP, 
and EI_EXPOSE_REP2.
+  Move Exception classes out of the impl package.
 
 
   Don't create 
un-needed resources in FileUploadBase.java
diff --git a/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java 
b/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java
index ae97bc0..bae9532 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java
@@ -19,8 +19,8 @@ package org.apache.commons.fileupload2;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.commons.fileupload2.impl.FileSizeLimitExceededException;
-import org.apache.commons.fileupload2.impl.SizeLimitExceededException;
+import org.apache.commons.fileupload2.pub.FileSizeLimitExceededException;
+import org.apache.commons.fileupload2.pub.SizeLimitExceededException;
 
 /**
  * An iterator, as returned by
diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java 
b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index 1626077..8ed5f72 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -31,8 +31,8 @@ import java.util.Objects;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.fileupload2.impl.FileItemIteratorImpl;
-import org.apache.commons.fileupload2.impl.FileUploadIOException;
-import org.apache.commons.fileupload2.impl.IOFileUploadException;
+import org.apache.commons.fileupload2.pub.FileUploadIOException;
+import org.apache.commons.fileupload2.pub.IOFileUploadException;
 import org.apache.commons.fileupload2.servlet.ServletFileUpload;
 import org.apache.commons.fileupload2.servlet.ServletRequestContext;
 import org.apache.commons.fileupload2.util.FileItemHeadersImpl;
diff --git a/src/main/java/org/apache/commons/fileupload2/MultipartStream.java 
b/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
index e7ff716..6623eae 100644
--- a/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
+++ b/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
@@ -24,7 +24,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 
-import org.apache.commons.fileupload2.impl.FileUploadIOException;
+import org.apache.commons.fileupload2.pub.FileUploadIOException;
 import org.apache.commons.fileupload2.util.Closeable;
 import org.apache.commons.fileupload2.util.Streams;
 
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 c320f02..9a1a0f5 100644
--- 
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
+++ 
b/src/main/java/org/apache/commons/fileupload2/impl/FileIte

[commons-fileupload] branch master updated: Update Spotbugs from 4.2.3 to 4.4.0, ignore EI_EXPOSE_REP, and EI_EXPOSE_REP2.

2021-08-19 Thread jochen
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 fe202dc  Update Spotbugs from 4.2.3 to 4.4.0, ignore EI_EXPOSE_REP, 
and EI_EXPOSE_REP2.
fe202dc is described below

commit fe202dcc808827241908255d9ae335b13b998ee9
Author: Jochen Wiedmann 
AuthorDate: Thu Aug 19 22:55:38 2021 +0200

Update Spotbugs from 4.2.3 to 4.4.0, ignore EI_EXPOSE_REP, and 
EI_EXPOSE_REP2.
---
 pom.xml | 2 +-
 spotbugs-exclude-filter.xml | 3 +++
 src/changes/changes.xml | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index edfb880..927f435 100644
--- a/pom.xml
+++ b/pom.xml
@@ -248,7 +248,7 @@
 Rob Tompkins
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
 4.3.0
-4.2.3
+4.4.0
 3.1.2
 
   
diff --git a/spotbugs-exclude-filter.xml b/spotbugs-exclude-filter.xml
index bd8489a..d2d2c32 100644
--- a/spotbugs-exclude-filter.xml
+++ b/spotbugs-exclude-filter.xml
@@ -54,4 +54,7 @@
 
 
 
+
+
+
 
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 71f6b06..9d1cbbc 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -59,6 +59,7 @@ The  type attribute can be add,update,fix,remove.
   Bump build actions/setup-java from v1.4.3 to v2.
   Bump spotbugs-maven-plugin from 4.2.3 to 4.3.0 
#103.
   FILEUPLOAD-340 Make commons-fileupload2 a JPMS module by adding 
module-info.class.
+  Update Spotbugs from 4.2.3 to 4.4.0, ignore EI_EXPOSE_REP, 
and EI_EXPOSE_REP2.
 
 
   Don't create 
un-needed resources in FileUploadBase.java


[commons-fileupload] branch master updated (9024c19 -> b6a25b5)

2021-08-19 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 9024c19  Bump commons-io from 2.10.0 to 2.11.0 #104.
 add b6a25b5  FILEUPLOAD-340 Make commons-fileupload a proper JPMS module 
(#107)

No new revisions were added by this update.

Summary of changes:
 pom.xml | 40 
 src/changes/changes.xml |  1 +
 2 files changed, 41 insertions(+)


[commons-email] branch Features/Email198 created (now 1992a9d)

2021-08-12 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

jochen pushed a change to branch Features/Email198
in repository https://gitbox.apache.org/repos/asf/commons-email.git.


  at 1992a9d  Initial work on EMAIL-198

This branch includes the following new commits:

 new 1992a9d  Initial work on EMAIL-198

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[commons-email] 01/01: Initial work on EMAIL-198

2021-08-12 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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

commit 1992a9d751fabcb4cd566b6ca37d127fce13c620
Author: Jochen Wiedmann 
AuthorDate: Thu Aug 12 12:24:17 2021 +0200

Initial work on EMAIL-198
---
 .../apache/commons/mail/re/AbstractMatcher.java| 51 +
 .../apache/commons/mail/re/AttributeSkipper.java   | 62 
 .../commons/mail/re/AttributeValueMatcher.java | 45 
 .../org/apache/commons/mail/re/HtmlTagMatcher.java | 57 +++
 .../java/org/apache/commons/mail/re/IMatcher.java  | 69 ++
 .../apache/commons/mail/re/ImageTagHandler.java| 84 ++
 .../org/apache/commons/mail/re/package-info.java   | 31 
 .../org/apache/commons/mail/AbstractEmailTest.java | 10 ++-
 .../apache/commons/mail/ImageHtmlEmailTest.java| 22 +-
 .../commons/mail/re/AttributeSkipperTest.java  | 59 +++
 .../apache/commons/mail/re/HtmlTagMatcherTest.java | 36 ++
 .../org/apache/commons/mail/re/MatcherTests.java   | 49 +
 12 files changed, 572 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/mail/re/AbstractMatcher.java 
b/src/main/java/org/apache/commons/mail/re/AbstractMatcher.java
new file mode 100644
index 000..985623e
--- /dev/null
+++ b/src/main/java/org/apache/commons/mail/re/AbstractMatcher.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.mail.re;
+
+
+/** Abstract base class for deriving implementations of {@link IMatcher}.
+ */
+public abstract class AbstractMatcher implements IMatcher {
+
+   /** Checks, whether a given word is in the given text at the given 
offset.
+* @param text The text, in which the word should be present.
+* @param offset The offset, at which to look for the word.
+* @param word The word to look for.
+* @param caseInsensitive Whether the match might be case insensitive.
+* @return True, if the word is founf. Otherwise false.
+*/
+   protected boolean isWordAt(String text, int offset, String word, 
boolean caseInsensitive) {
+   if (offset+word.length() <= text.length()) {
+   for (int i = 0;  i < word.length();  i++) {
+   final char c1 = text.charAt(offset+i);
+   final char c2 = word.charAt(i);
+   if (caseInsensitive) {
+   if (Character.toLowerCase(c1) != 
Character.toLowerCase(c2)) {
+   return false;
+   }
+   } else {
+   if (c1 != c2) {
+   return false;
+   }
+   }
+   }
+   return true;
+   }
+   return false;
+   }
+
+}
diff --git a/src/main/java/org/apache/commons/mail/re/AttributeSkipper.java 
b/src/main/java/org/apache/commons/mail/re/AttributeSkipper.java
new file mode 100644
index 000..34895f5
--- /dev/null
+++ b/src/main/java/org/apache/commons/mail/re/AttributeSkipper.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License f

[commons-fileupload] 01/01: Merge pull request #101 from apache/dependabot/maven/commons-io-commons-io-2.10.0

2021-06-15 Thread jochen
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

commit d5a03ee7fb1a7ccdf718d4b04150a1ecd48caabd
Merge: 31067dd 6ffad8c
Author: Jochen Wiedmann 
AuthorDate: Tue Jun 15 22:17:36 2021 +0200

Merge pull request #101 from 
apache/dependabot/maven/commons-io-commons-io-2.10.0

Bump commons-io from 2.9.0 to 2.10.0

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated (31067dd -> d5a03ee)

2021-06-15 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 31067dd  Replace Java 15 with Java 16 in Travis CI.
 add 6ffad8c  Bump commons-io from 2.9.0 to 2.10.0
 new d5a03ee  Merge pull request #101 from 
apache/dependabot/maven/commons-io-commons-io-2.10.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated: Add .asf.yaml with GitHub project info only (description, URL, labels)

2021-05-29 Thread jochen
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 9547202  Add .asf.yaml with GitHub project info only (description, 
URL, labels)
 new ee829ac  Merge pull request #99 from arturobernalg/feature/asf.yaml
9547202 is described below

commit 9547202b7f0aeefd4a6025acfac7115e913789ac
Author: Arturo Bernal 
AuthorDate: Fri May 28 19:29:04 2021 +0200

Add .asf.yaml with GitHub project info only (description, URL, labels)
---
 .asf.yaml | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/.asf.yaml b/.asf.yaml
new file mode 100644
index 000..57d9289
--- /dev/null
+++ b/.asf.yaml
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+github:
+  description: "Apache Commons FileUpload is a robust, high-performance, file 
upload capability to your servlets and web applications"
+  homepage: https://commons.apache.org/proper/commons-fileupload/
+  labels:
+- java
+- fileupload
+- upload
+- apache


[commons-fileupload] branch master updated: Fix checkstyle warnings

2021-05-28 Thread jochen
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 13ecf90  Fix checkstyle warnings
 new a9d7ca9  Merge pull request #93 from 
arturobernalg/feature/solve_checkstyle
13ecf90 is described below

commit 13ecf9082640032f7e96e26655f2aca063544113
Author: Arturo Bernal 
AuthorDate: Sun May 23 15:13:10 2021 +0200

Fix checkstyle warnings
---
 .../fileupload2/impl/FileItemIteratorImpl.java | 17 +-
 .../fileupload2/impl/FileItemStreamImpl.java   |  7 +++-
 .../ParseException.java => impl/package-info.java} | 21 ++--
 .../fileupload2/util/mime/Base64Decoder.java   |  2 +-
 .../fileupload2/util/mime/ParseException.java  |  2 +-
 .../fileupload2/util/mime/RFC2231Utility.java  | 38 +-
 6 files changed, 55 insertions(+), 32 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 6143270..c320f02 100644
--- 
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
+++ 
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
@@ -44,9 +44,24 @@ import org.apache.commons.io.IOUtils;
  * {@link FileUploadBase#getItemIterator(RequestContext)}.
  */
 public class FileItemIteratorImpl implements FileItemIterator {
+/**
+ * The file uploads processing utility.
+ * @see FileUploadBase
+ */
 private final FileUploadBase fileUploadBase;
+/**
+ * The request context.
+ * @see RequestContext
+ */
 private final RequestContext ctx;
-private long sizeMax, fileSizeMax;
+/**
+ * The maximum allowed size of a complete request.
+ */
+private long sizeMax;
+/**
+ * The maximum allowed size of a single uploaded file.
+ */
+private long fileSizeMax;
 
 
 @Override
diff --git 
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java 
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
index 7a25d55..e3a9b25 100644
--- a/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
+++ b/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
@@ -35,6 +35,11 @@ import org.apache.commons.fileupload2.util.Streams;
  * Default implementation of {@link FileItemStream}.
  */
 public class FileItemStreamImpl implements FileItemStream {
+/**
+ * The File Item iterator implementation.
+ *
+ * @see FileItemIteratorImpl
+ */
 private final FileItemIteratorImpl fileItemIteratorImpl;
 
 /**
@@ -50,7 +55,7 @@ public class FileItemStreamImpl implements FileItemStream {
 /**
  * The file items file name.
  */
-final String name;
+private final String name;
 
 /**
  * Whether the file item is a form field.
diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/ParseException.java 
b/src/main/java/org/apache/commons/fileupload2/impl/package-info.java
similarity index 63%
copy from 
src/main/java/org/apache/commons/fileupload2/util/mime/ParseException.java
copy to src/main/java/org/apache/commons/fileupload2/impl/package-info.java
index 38f3d91..93c87ac 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/ParseException.java
+++ b/src/main/java/org/apache/commons/fileupload2/impl/package-info.java
@@ -14,25 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.fileupload2.util.mime;
 
 /**
- * @since 1.3
+ * Implementations and exceptions utils.
  */
-final class ParseException extends Exception {
-
-/**
- * The UID to use when serializing this instance.
- */
-private static final long serialVersionUID = 5355281266579392077L;
-
-/**
- * Constructs a new exception with the specified detail message.
- *
- * @param message the detail message.
- */
-public ParseException(final String message) {
-super(message);
-}
-
-}
+package org.apache.commons.fileupload2.impl;
diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java 
b/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java
index 231df63..9b32d2d 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java
@@ -104,7 +104,7 @@ final class Base64Decoder {
  */
 public static int decode(final byte[] data, final OutputStream out) throws 
IOException {
 intoutLen = 0;
-final byte[ ] cache = new byte[INPUT_BYTES_PER_CHUNK];
+final byte[] cache = new byte[INPUT_BYTES_PER_CHUNK];
 int cachedBy

[commons-fileupload] branch master updated: .travis.yml: * run default goal * Add -V --show-version * Add --no-transfer-progress

2021-05-28 Thread jochen
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 6f6a784  .travis.yml: * run default goal * Add -V --show-version * Add 
--no-transfer-progress
 new 4531ac9  Merge pull request #100 from arturobernalg/feature/travis_goal
6f6a784 is described below

commit 6f6a784b00bcbe790ab6c2ae3ccda0d4b0c4f0f4
Author: Arturo Bernal 
AuthorDate: Fri May 28 19:34:40 2021 +0200

.travis.yml:
* run default goal
* Add -V --show-version
* Add --no-transfer-progress
---
 .travis.yml | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index b080515..f6979f5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,5 +27,8 @@ matrix:
   allow_failures:
 - jdk: openjdk-ea
 
+script:
+  - mvn -V --no-transfer-progress
+
 after_success:
-  - mvn clean test jacoco:report coveralls:report -Ptravis-jacoco
+  - mvn -V clean test jacoco:report coveralls:report -Ptravis-jacoco 
--no-transfer-progress


[commons-fileupload] branch master updated: Remove AvoidInlineConditionals rule. Remove checkstyle license validations in favor of rat plugin. Add defaultGoal checkstyle validations.

2021-05-28 Thread jochen
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 6ed7f3c  Remove AvoidInlineConditionals rule. Remove checkstyle 
license validations in favor of rat plugin. Add defaultGoal checkstyle 
validations.
 new 000db65  Merge pull request #92 from arturobernalg/checkstyle_enhance
6ed7f3c is described below

commit 6ed7f3cc78ad3e6c5425ba2c5bc781383f420276
Author: Arturo Bernal 
AuthorDate: Sun May 23 14:59:24 2021 +0200

Remove AvoidInlineConditionals rule.
Remove checkstyle license validations in favor of rat plugin.
Add defaultGoal checkstyle validations.
---
 pom.xml  | 19 ---
 src/checkstyle/fileupload_checks.xml |  6 --
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index cf6f43b..9e2dfc3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -234,6 +234,8 @@
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
 4.2.3
 4.2.3
+3.1.2
+
   
 
   
@@ -357,9 +359,20 @@
 
   
 
+
+  org.apache.maven.plugins
+  maven-checkstyle-plugin
+  ${checkstyle.plugin.version}
+  
+
${basedir}/src/checkstyle/fileupload_checks.xml
+
${basedir}/src/checkstyle/checkstyle-suppressions.xml
+false
+false
+  
+
   
 
-clean verify apache-rat:check clirr:check javadoc:javadoc 
spotbugs:check
+clean verify apache-rat:check clirr:check checkstyle:check 
javadoc:javadoc spotbugs:check
   
 
   
@@ -383,12 +396,12 @@
   
 org.apache.maven.plugins
 maven-checkstyle-plugin
-3.1.2
+${checkstyle.plugin.version}
 
   
${basedir}/src/checkstyle/fileupload_checks.xml
   
${basedir}/src/checkstyle/checkstyle-suppressions.xml
+  false
   false
-  
${basedir}/src/checkstyle/license-header.txt
 
   
   
diff --git a/src/checkstyle/fileupload_checks.xml 
b/src/checkstyle/fileupload_checks.xml
index 7ef9935..1abd1d5 100644
--- a/src/checkstyle/fileupload_checks.xml
+++ b/src/checkstyle/fileupload_checks.xml
@@ -74,11 +74,6 @@
 
 
 
-
-
-
-
-
 
 
 
@@ -200,7 +195,6 @@
 
 
 
-
 
 
 


[commons-codec] branch master updated (d7cc6db -> ac495d6)

2021-05-28 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from d7cc6db  Track changes
 add c05eb1b  Bump actions/cache from 2.1.4 to 2.1.6
 add ac495d6  Merge pull request #87 from 
apache/dependabot/github_actions/actions/cache-2.1.6

No new revisions were added by this update.

Summary of changes:
 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] 01/01: Merge pull request #98 from apache/dependabot/github_actions/actions/cache-2.1.6

2021-05-28 Thread jochen
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

commit 8bfd7635416db67e6f55fab86beae8bc53ada8e9
Merge: f26e824 44032e6
Author: Jochen Wiedmann 
AuthorDate: Fri May 28 09:01:03 2021 +0200

Merge pull request #98 from 
apache/dependabot/github_actions/actions/cache-2.1.6

Bump actions/cache from 2.1.5 to 2.1.6

 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated (f26e824 -> 8bfd763)

2021-05-28 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from f26e824  Merge pull request #97 from 
arturobernalg/feature/uploadContext
 add 44032e6  Bump actions/cache from 2.1.5 to 2.1.6
 new 8bfd763  Merge pull request #98 from 
apache/dependabot/github_actions/actions/cache-2.1.6

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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

2021-05-27 Thread jochen
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 
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()


[commons-fileupload] branch master updated: Improvements: Use Lambda

2021-05-27 Thread jochen
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 6b1eb55  Improvements: Use Lambda
 new 4a0264e  Merge pull request #96 from arturobernalg/feature/improvements
6b1eb55 is described below

commit 6b1eb55b4878869f7c364278c20d54e242cae242
Author: Arturo Bernal 
AuthorDate: Thu May 27 21:35:34 2021 +0200

Improvements:
Use Lambda

* Fix javadoc
* Remove Redundant type cast
* Remove unnecessarily escaped character
* Remove redundant type cast
* Remove redundant String operation
---
 .../org/apache/commons/fileupload2/FileUploadBase.java   |  5 ++---
 .../commons/fileupload2/util/mime/MimeUtility.java   |  4 ++--
 .../apache/commons/fileupload2/ParameterParserTest.java  | 16 
 .../fileupload2/jaksrvlt/JakSrvltFileUploadTest.java |  2 +-
 .../fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java|  4 ++--
 .../fileupload2/util/mime/RFC2231UtilityTestCase.java|  4 +---
 6 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java 
b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index f90e7e1..1626077 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -31,7 +31,6 @@ import java.util.Objects;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.fileupload2.impl.FileItemIteratorImpl;
-import org.apache.commons.fileupload2.impl.FileItemStreamImpl;
 import org.apache.commons.fileupload2.impl.FileUploadIOException;
 import org.apache.commons.fileupload2.impl.IOFileUploadException;
 import org.apache.commons.fileupload2.servlet.ServletFileUpload;
@@ -333,7 +332,7 @@ public abstract class FileUploadBase {
 while (iter.hasNext()) {
 final FileItemStream item = iter.next();
 // Don't use getName() here to prevent an 
InvalidFileNameException.
-final String fileName = ((FileItemStreamImpl) item).getName();
+final String fileName = item.getName();
 final FileItem fileItem = 
fileItemFactory.createItem(item.getFieldName(), item.getContentType(),
item.isFormField(), 
fileName);
 items.add(fileItem);
@@ -585,7 +584,7 @@ public abstract class FileUploadBase {
 }
 // Continuation line found
 end = parseEndOfLine(headerPart, nonWs);
-header.append(" ").append(headerPart.substring(nonWs, end));
+header.append(" ").append(headerPart, nonWs, end);
 start = end + 2;
 }
 parseHeaderLine(headers, header.toString());
diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java 
b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
index c3f2387..57a3319 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
@@ -150,7 +150,7 @@ public final class MimeUtility {
 
 // are any whitespace characters significant?  Append 
'em if we've got 'em.
 if (!previousTokenEncoded && startWhiteSpace != -1) {
-decodedText.append(text.substring(startWhiteSpace, 
endWhiteSpace));
+decodedText.append(text, startWhiteSpace, 
endWhiteSpace);
 startWhiteSpace = -1;
 }
 // this is definitely a decoded token.
@@ -168,7 +168,7 @@ public final class MimeUtility {
 // this is a normal token, so it doesn't matter what the 
previous token was.  Add the white space
 // if we have it.
 if (startWhiteSpace != -1) {
-decodedText.append(text.substring(startWhiteSpace, 
endWhiteSpace));
+decodedText.append(text, startWhiteSpace, endWhiteSpace);
 startWhiteSpace = -1;
 }
 // this is not a decoded token.
diff --git 
a/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java 
b/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
index bfab434..1edbfda 100644
--- a/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
@@ -129,29 +129,29 @@ public class ParameterParserTest {
 
 // Should parse a UTF-8 charset
 String s = "Content-Disposition: form-data; "
-+ "name=\&

[commons-fileupload] branch master updated (e7ecf9e -> a903843)

2021-05-26 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from e7ecf9e  Merge pull request #94 from arturobernalg/feature/use_contains
 add 8370f1e  Bump commons-io from 2.8.0 to 2.9.0
 new a903843  Merge pull request #95 from 
apache/dependabot/maven/commons-io-commons-io-2.9.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] 01/01: Merge pull request #95 from apache/dependabot/maven/commons-io-commons-io-2.9.0

2021-05-26 Thread jochen
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

commit a903843f60b763ef88d9e29843e8251c4968ae0c
Merge: e7ecf9e 8370f1e
Author: Jochen Wiedmann 
AuthorDate: Wed May 26 08:18:10 2021 +0200

Merge pull request #95 from 
apache/dependabot/maven/commons-io-commons-io-2.9.0

Bump commons-io from 2.8.0 to 2.9.0

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated: Replace indexOf() with contains()

2021-05-25 Thread jochen
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 7f02be4  Replace indexOf() with contains()
 new e7ecf9e  Merge pull request #94 from arturobernalg/feature/use_contains
7f02be4 is described below

commit 7f02be4a08481fe319126b797353f641e9a42214
Author: Arturo Bernal 
AuthorDate: Tue May 25 06:32:09 2021 +0200

Replace indexOf() with contains()
---
 .../java/org/apache/commons/fileupload2/util/mime/MimeUtility.java| 2 +-
 src/test/java/org/apache/commons/fileupload2/StreamingTest.java   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java 
b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
index 460c890..c3f2387 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
@@ -95,7 +95,7 @@ public final class MimeUtility {
 public static String decodeText(final String text) throws 
UnsupportedEncodingException {
 // if the text contains any encoded tokens, those tokens will be 
marked with "=?".  If the
 // source string doesn't contain that sequent, no decoding is required.
-if (text.indexOf(ENCODED_TOKEN_MARKER) < 0) {
+if (!text.contains(ENCODED_TOKEN_MARKER)) {
 return text;
 }
 
diff --git a/src/test/java/org/apache/commons/fileupload2/StreamingTest.java 
b/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
index 0ee80cd..bf4fa98 100644
--- a/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
@@ -265,7 +265,7 @@ public class StreamingTest {
 } catch (final InvalidFileNameException e) {
 assertEquals(fileName, e.getName());
 assertEquals(-1, e.getMessage().indexOf(fileName));
-assertTrue(e.getMessage().indexOf("foo.exe\\0.png") != -1);
+assertTrue(e.getMessage().contains("foo.exe\\0.png"));
 }
 
 try {
@@ -274,7 +274,7 @@ public class StreamingTest {
 } catch (final InvalidFileNameException e) {
 assertEquals(fileName, e.getName());
 assertEquals(-1, e.getMessage().indexOf(fileName));
-assertTrue(e.getMessage().indexOf("foo.exe\\0.png") != -1);
+assertTrue(e.getMessage().contains("foo.exe\\0.png"));
 }
 }
 


[commons-fileupload] 01/01: Merge pull request #90 from apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.2

2021-05-18 Thread jochen
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

commit 516552828b7ee2a9ac2e5d58c987cccedd0aa857
Merge: 6e499fd 4deff6d
Author: Jochen Wiedmann 
AuthorDate: Tue May 18 20:59:23 2021 +0200

Merge pull request #90 from 
apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.2

Bump junit-jupiter from 5.7.1 to 5.7.2

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated (6e499fd -> 5165528)

2021-05-18 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 6e499fd  Merge pull request #88 from 
arturobernalg/feature/FILEUPLOAD-336
 add 4deff6d  Bump junit-jupiter from 5.7.1 to 5.7.2
 new 5165528  Merge pull request #90 from 
apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.2

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated: FILEUPLOAD-336 - WhitespaceAround

2021-05-16 Thread jochen
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 b5c9fd7  FILEUPLOAD-336 - WhitespaceAround
 new 6e499fd  Merge pull request #88 from 
arturobernalg/feature/FILEUPLOAD-336
b5c9fd7 is described below

commit b5c9fd79506f237da028c274eef2d9f9bb3d41bf
Author: Arturo Bernal 
AuthorDate: Mon May 10 06:27:06 2021 +0200

FILEUPLOAD-336 - WhitespaceAround
---
 .../fileupload2/util/mime/Base64Decoder.java   |  2 +-
 .../commons/fileupload2/DefaultFileItemTest.java   |  4 ++--
 .../fileupload2/DiskFileItemSerializeTest.java |  4 ++--
 .../commons/fileupload2/DiskFileUploadTest.java|  5 -
 .../commons/fileupload2/ParameterParserTest.java   | 14 ++---
 .../commons/fileupload2/ProgressListenerTest.java  | 24 +++---
 .../apache/commons/fileupload2/StreamingTest.java  |  8 
 .../util/mime/Base64DecoderTestCase.java   |  4 ++--
 8 files changed, 34 insertions(+), 31 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java 
b/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java
index a4ecbeb..231df63 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/Base64Decoder.java
@@ -104,7 +104,7 @@ final class Base64Decoder {
  */
 public static int decode(final byte[] data, final OutputStream out) throws 
IOException {
 intoutLen = 0;
-final byte [] cache = new byte[INPUT_BYTES_PER_CHUNK];
+final byte[ ] cache = new byte[INPUT_BYTES_PER_CHUNK];
 int cachedBytes = 0;
 
 for (final byte b : data) {
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java 
b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
index 0dd3f47..ee662d5 100644
--- a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
@@ -120,7 +120,7 @@ public class DefaultFileItemTest {
 final OutputStream os = item.getOutputStream();
 os.write(testFieldValueBytes);
 os.close();
-} catch(final IOException e) {
+} catch (final IOException e) {
 fail("Unexpected IOException");
 }
 assertTrue(item.isInMemory());
@@ -183,7 +183,7 @@ public class DefaultFileItemTest {
 final OutputStream os = item.getOutputStream();
 os.write(testFieldValueBytes);
 os.close();
-} catch(final IOException e) {
+} catch (final IOException e) {
 fail("Unexpected IOException");
 }
 assertFalse(item.isInMemory());
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java 
b/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
index fcada8e..295b857 100644
--- 
a/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
+++ 
b/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
@@ -194,7 +194,7 @@ public class DiskFileItemSerializeTest {
 final StringBuilder buffer = new StringBuilder(size);
 byte count = 0;
 for (int i = 0; i < size; i++) {
-buffer.append(count+"");
+buffer.append(count + "");
 count++;
 if (count > 9) {
 count = 0;
@@ -220,7 +220,7 @@ public class DiskFileItemSerializeTest {
 final OutputStream os = item.getOutputStream();
 os.write(contentBytes);
 os.close();
-} catch(final IOException e) {
+} catch (final IOException e) {
 fail("Unexpected IOException" + e);
 }
 
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java 
b/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java
index ecbec92..37df62d 100644
--- a/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.commons.fileupload2;
 
-import static org.junit.jupiter.api.Assertions.*;
 
 import java.io.File;
 import java.nio.charset.StandardCharsets;
@@ -29,6 +28,10 @@ import 
org.apache.commons.fileupload2.impl.InvalidContentTypeException;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
+
 /**
  * Test for {@link DiskFileUpload}. Remove when deprecated clas

[commons-fileupload] branch master updated: FILEUPLOAD-334 - LineLength - Line is longer than 120 characters

2021-05-16 Thread jochen
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 64caa71  FILEUPLOAD-334 - LineLength - Line is longer than 120 
characters
 new 5b5e8a6  Merge pull request #86 from 
arturobernalg/feature/FILEUPLOAD-334
64caa71 is described below

commit 64caa719fb84bdf6054ee716184c66716e5538f0
Author: Arturo Bernal 
AuthorDate: Fri May 7 16:17:16 2021 +0200

FILEUPLOAD-334 - LineLength - Line is longer than 120 characters
---
 .../java/org/apache/commons/fileupload2/FileUploadBase.java  |  3 ++-
 .../commons/fileupload2/impl/FileItemIteratorImpl.java   |  3 ++-
 .../java/org/apache/commons/fileupload2/util/Streams.java|  3 ++-
 .../apache/commons/fileupload2/util/mime/RFC2231Utility.java |  6 --
 .../org/apache/commons/fileupload2/FileItemHeadersTest.java  |  6 --
 .../java/org/apache/commons/fileupload2/FileUploadTest.java  | 12 
 .../org/apache/commons/fileupload2/ParameterParserTest.java  |  6 --
 src/test/java/org/apache/commons/fileupload2/Util.java   |  3 ++-
 .../fileupload2/portlet/MockPortletActionRequest.java|  3 ++-
 .../commons/fileupload2/util/mime/Base64DecoderTestCase.java |  3 ++-
 .../commons/fileupload2/util/mime/MimeUtilityTestCase.java   |  6 --
 .../util/mime/QuotedPrintableDecoderTestCase.java|  8 +---
 .../fileupload2/util/mime/RFC2231UtilityTestCase.java|  6 --
 13 files changed, 45 insertions(+), 23 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java 
b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index 292b3f2..f90e7e1 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -327,7 +327,8 @@ public abstract class FileUploadBase {
 boolean successful = false;
 try {
 final FileItemIterator iter = getItemIterator(ctx);
-final FileItemFactory fileItemFactory = 
Objects.requireNonNull(getFileItemFactory(), "No FileItemFactory has been 
set.");
+final FileItemFactory fileItemFactory = 
Objects.requireNonNull(getFileItemFactory(),
+"No FileItemFactory has been set.");
 final byte[] buffer = new byte[Streams.DEFAULT_BUFFER_SIZE];
 while (iter.hasNext()) {
 final FileItemStream item = iter.next();
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 4af1d60..2044d06 100644
--- 
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
+++ 
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
@@ -336,7 +336,8 @@ public class FileItemIteratorImpl implements 
FileItemIterator {
 final List items = new ArrayList<>();
 while (hasNext()) {
 final FileItemStream fis = next();
-final FileItem fi = 
fileUploadBase.getFileItemFactory().createItem(fis.getFieldName(), 
fis.getContentType(), fis.isFormField(), fis.getName());
+final FileItem fi = 
fileUploadBase.getFileItemFactory().createItem(fis.getFieldName(),
+fis.getContentType(), fis.isFormField(), fis.getName());
 items.add(fi);
 }
 return items;
diff --git a/src/main/java/org/apache/commons/fileupload2/util/Streams.java 
b/src/main/java/org/apache/commons/fileupload2/util/Streams.java
index 5f40514..2aa1302 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/Streams.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/Streams.java
@@ -62,7 +62,8 @@ public final class Streams {
  * @return Number of bytes, which have been copied.
  * @throws IOException An I/O error occurred.
  */
-public static long copy(final InputStream inputStream, final OutputStream 
outputStream, final boolean closeOutputStream)
+public static long copy(final InputStream inputStream, final OutputStream 
outputStream,
+final boolean closeOutputStream)
 throws IOException {
 return copy(inputStream, outputStream, closeOutputStream, new 
byte[DEFAULT_BUFFER_SIZE]);
 }
diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java 
b/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
index ee0e13c..18d0609 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
@@ -22,7 +22,8 @@ import java.io.UnsupportedEncodingException;
  * Utility class to decode/encode character set on HTTP Header

[commons-fileupload] branch master updated: FILEUPLOAD-335 - ConstantName and Operator Order

2021-05-14 Thread jochen
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 178ff6e  FILEUPLOAD-335 - ConstantName and Operator Order
 new 09d6305  Merge pull request #87 from 
arturobernalg/feature/FILEUPLOAD-335
178ff6e is described below

commit 178ff6e52239ae1127ad8d77c286fe2f41fc80c4
Author: Arturo Bernal 
AuthorDate: Sat May 8 09:00:06 2021 +0200

FILEUPLOAD-335 - ConstantName and Operator Order
---
 .../org/apache/commons/fileupload2/Constants.java|  2 +-
 .../commons/fileupload2/DefaultFileItemTest.java | 20 ++--
 .../fileupload2/DiskFileItemSerializeTest.java   | 20 ++--
 .../fileupload2/HttpServletRequestFactory.java   |  4 ++--
 .../commons/fileupload2/MockHttpServletRequest.java  | 20 ++--
 .../commons/fileupload2/ProgressListenerTest.java| 14 +++---
 .../jaksrvlt/MockJakSrvltHttpRequest.java| 20 ++--
 7 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/src/test/java/org/apache/commons/fileupload2/Constants.java 
b/src/test/java/org/apache/commons/fileupload2/Constants.java
index 8400bff..7389018 100644
--- a/src/test/java/org/apache/commons/fileupload2/Constants.java
+++ b/src/test/java/org/apache/commons/fileupload2/Constants.java
@@ -28,5 +28,5 @@ public final class Constants {
  */
 public static final String CONTENT_TYPE = "multipart/form-data; 
boundary=---1234";
 
-private Constants() {}
+private Constants() { }
 }
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java 
b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
index 8046fd0..0dd3f47 100644
--- a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
@@ -42,17 +42,17 @@ public class DefaultFileItemTest {
 /**
  * Content type for regular form items.
  */
-private static final String textContentType = "text/plain";
+private static final String TEXT_CONTENT_TYPE = "text/plain";
 
 /**
  * Content type for file uploads.
  */
-private static final String fileContentType = "application/octet-stream";
+private static final String FILE_CONTENT_TYPE = "application/octet-stream";
 
 /**
  * Very low threshold for testing memory versus disk options.
  */
-private static final int threshold = 16;
+private static final int THRESHOLD = 16;
 
 /**
  * Test construction of a regular text field.
@@ -64,13 +64,13 @@ public class DefaultFileItemTest {
 
 final FileItem item = factory.createItem(
 textFieldName,
-textContentType,
+TEXT_CONTENT_TYPE,
 true,
 null
 );
 assertNotNull(item);
 assertEquals(item.getFieldName(), textFieldName);
-assertEquals(item.getContentType(), textContentType);
+assertEquals(item.getContentType(), TEXT_CONTENT_TYPE);
 assertTrue(item.isFormField());
 assertNull(item.getName());
 }
@@ -86,13 +86,13 @@ public class DefaultFileItemTest {
 
 final FileItem item = factory.createItem(
 fileFieldName,
-fileContentType,
+FILE_CONTENT_TYPE,
 false,
 fileName
 );
 assertNotNull(item);
 assertEquals(item.getFieldName(), fileFieldName);
-assertEquals(item.getContentType(), fileContentType);
+assertEquals(item.getContentType(), FILE_CONTENT_TYPE);
 assertFalse(item.isFormField());
 assertEquals(item.getName(), fileName);
 }
@@ -110,7 +110,7 @@ public class DefaultFileItemTest {
 
 final FileItem item = factory.createItem(
 textFieldName,
-textContentType,
+TEXT_CONTENT_TYPE,
 true,
 null
 );
@@ -173,7 +173,7 @@ public class DefaultFileItemTest {
 
 final FileItem item = factory.createItem(
 textFieldName,
-textContentType,
+TEXT_CONTENT_TYPE,
 true,
 null
 );
@@ -219,7 +219,7 @@ public class DefaultFileItemTest {
  * @return the new {@code FileItemFactory} instance.
  */
 protected FileItemFactory createFactory(final File repository) {
-return new DefaultFileItemFactory(threshold, repository);
+return new DefaultFileItemFactory(THRESHOLD, repository);
 }
 
 static final String CHARSET_ISO88591 = "ISO-8859-1";
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java 
b/src/test/java/org/apache/comm

[commons-fileupload] branch master updated: Fix the site's team link.

2021-05-14 Thread jochen
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 6787168  Fix the site's team link.
 new 6692f15  Merge pull request #89 from arturobernalg/bugfix/site-team
6787168 is described below

commit 67871685254a99416edc61aea06f86ecae2cb6ff
Author: Arturo Bernal 
AuthorDate: Wed May 12 20:30:08 2021 +0200

Fix the site's team link.
---
 src/site/site.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/site/site.xml b/src/site/site.xml
index 0f1dc17..a990e56 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -36,7 +36,7 @@
   
   
   
-  
+  
   
 
   


[commons-fileupload] branch master updated (60841db -> 5352ef0)

2021-05-07 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 60841db  Merge pull request #84 from 
arturobernalg/feature/FILEUPLOAD-332
 new c621327  FILEUPLOAD-333 - Add Newline At End Of File
 new 5352ef0  Merge pull request #85 from 
arturobernalg/feature/FILEUPLOAD-333

The 1123 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java  | 2 +-
 .../java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java| 2 +-
 .../apache/commons/fileupload2/impl/FileSizeLimitExceededException.java | 2 +-
 .../java/org/apache/commons/fileupload2/impl/FileUploadIOException.java | 2 +-
 .../java/org/apache/commons/fileupload2/impl/IOFileUploadException.java | 2 +-
 .../apache/commons/fileupload2/impl/InvalidContentTypeException.java| 2 +-
 src/main/java/org/apache/commons/fileupload2/impl/SizeException.java| 2 +-
 .../org/apache/commons/fileupload2/impl/SizeLimitExceededException.java | 2 +-
 .../java/org/apache/commons/fileupload2/impl/UnknownSizeException.java  | 2 +-
 src/test/java/org/apache/commons/fileupload2/ProgressListenerTest.java  | 1 -
 src/test/java/org/apache/commons/fileupload2/StreamingTest.java | 1 -
 11 files changed, 9 insertions(+), 11 deletions(-)


[commons-fileupload] branch master updated: FILEUPLOAD-332 - Replace File Tab. Character with spaces

2021-05-07 Thread jochen
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 1b165d1  FILEUPLOAD-332 - Replace File Tab. Character with spaces
 new 60841db  Merge pull request #84 from 
arturobernalg/feature/FILEUPLOAD-332
1b165d1 is described below

commit 1b165d173ba2ef245dd010e1e04aaa4f75473148
Author: Arturo Bernal 
AuthorDate: Fri May 7 06:19:55 2021 +0200

FILEUPLOAD-332 - Replace File Tab. Character with spaces
---
 .../commons/fileupload2/FileItemIterator.java  |  74 
 .../fileupload2/impl/FileItemIteratorImpl.java |  68 +++
 .../fileupload2/impl/FileItemStreamImpl.java   |   4 +-
 .../apache/commons/fileupload2/util/Streams.java   |   2 +-
 .../commons/fileupload2/DiskFileUploadTest.java|   6 +-
 .../jaksrvlt/JakSrvltFileUploadTest.java   |   2 +-
 .../jaksrvlt/MockJakSrvltHttpRequest.java  | 200 ++---
 .../fileupload2/servlet/ServletFileUploadTest.java |   2 +-
 8 files changed, 179 insertions(+), 179 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java 
b/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java
index 9413805..ae97bc0 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileItemIterator.java
@@ -27,46 +27,46 @@ import 
org.apache.commons.fileupload2.impl.SizeLimitExceededException;
  * {@link FileUploadBase#getItemIterator(RequestContext)}.
  */
 public interface FileItemIterator {
-   /** Returns the maximum size of a single file. An {@link 
FileSizeLimitExceededException}
-* will be thrown, if there is an uploaded file, which is exceeding 
this value.
-* By default, this value will be copied from the {@link 
FileUploadBase#getFileSizeMax()
-* FileUploadBase} object, however, the user may replace the default 
value with a
-* request specific value by invoking {@link #setFileSizeMax(long)} on 
this object.
-* @return The maximum size of a single, uploaded file. The value -1 
indicates "unlimited".
-*/
-   long getFileSizeMax();
+/** Returns the maximum size of a single file. An {@link 
FileSizeLimitExceededException}
+ * will be thrown, if there is an uploaded file, which is exceeding this 
value.
+ * By default, this value will be copied from the {@link 
FileUploadBase#getFileSizeMax()
+ * FileUploadBase} object, however, the user may replace the default value 
with a
+ * request specific value by invoking {@link #setFileSizeMax(long)} on 
this object.
+ * @return The maximum size of a single, uploaded file. The value -1 
indicates "unlimited".
+ */
+long getFileSizeMax();
 
-   /** Sets the maximum size of a single file. An {@link 
FileSizeLimitExceededException}
-* will be thrown, if there is an uploaded file, which is exceeding 
this value.
-* By default, this value will be copied from the {@link 
FileUploadBase#getFileSizeMax()
-* FileUploadBase} object, however, the user may replace the default 
value with a
-* request specific value by invoking {@link #setFileSizeMax(long)} on 
this object, so
-* there is no need to configure it here.
-* Note:Changing this value doesn't affect files, that have 
already been uploaded.
-* @param pFileSizeMax The maximum size of a single, uploaded file. The 
value -1 indicates "unlimited".
-*/
-   void setFileSizeMax(long pFileSizeMax);
+/** Sets the maximum size of a single file. An {@link 
FileSizeLimitExceededException}
+ * will be thrown, if there is an uploaded file, which is exceeding this 
value.
+ * By default, this value will be copied from the {@link 
FileUploadBase#getFileSizeMax()
+ * FileUploadBase} object, however, the user may replace the default value 
with a
+ * request specific value by invoking {@link #setFileSizeMax(long)} on 
this object, so
+ * there is no need to configure it here.
+ * Note:Changing this value doesn't affect files, that have 
already been uploaded.
+ * @param pFileSizeMax The maximum size of a single, uploaded file. The 
value -1 indicates "unlimited".
+ */
+void setFileSizeMax(long pFileSizeMax);
 
-   /** Returns the maximum size of the complete HTTP request. A {@link 
SizeLimitExceededException}
-* will be thrown, if the HTTP request will exceed this value.
-* By default, this value will be copied from the {@link 
FileUploadBase#getSizeMax()
-* FileUploadBase} object, however, the user may replace the default 
value with a
-* request specific value by invoking {@link #setSizeMax(long)} on this 
object.
-* @return The maximum size of the comple

[commons-fileupload] branch master updated: FILEUPLOAD-329 - Fix multiples errors fileupload_checks.xml config file

2021-05-06 Thread jochen
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 f2ee201  FILEUPLOAD-329 - Fix multiples errors fileupload_checks.xml 
config file
 new ace4719  Merge pull request #82 from 
arturobernalg/feature/FILEUPLOAD-329
f2ee201 is described below

commit f2ee201c39322e73d5cde42e5a0d22754b4def0f
Author: Arturo Bernal 
AuthorDate: Wed May 5 18:00:22 2021 +0200

FILEUPLOAD-329 - Fix multiples errors fileupload_checks.xml config file
---
 src/checkstyle/fileupload_checks.xml | 38 ++--
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/checkstyle/fileupload_checks.xml 
b/src/checkstyle/fileupload_checks.xml
index 760cfa5..7ef9935 100644
--- a/src/checkstyle/fileupload_checks.xml
+++ b/src/checkstyle/fileupload_checks.xml
@@ -90,28 +90,36 @@
 
 
 
-
-
 
-
-
-
-
+
+
+
+
+
+
 
 
-
 
-
+
 
 
-
+
+
+
+  
+  
+  
+
+
+
+
+
 
 
 
 
   
-  
-  
 
 
 
@@ -153,11 +161,6 @@
 
 
 
-
-
-  
-  
-
 
 
 
@@ -205,9 +208,6 @@
 
 
 
-
-  
-
 
 
 


[commons-fileupload] branch master updated: FILEUPLOAD-330 - Add taglist-maven-plugin

2021-05-06 Thread jochen
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 44e7080  FILEUPLOAD-330 -  Add taglist-maven-plugin
 new 8cd22e5  Merge pull request #83 from 
arturobernalg/feature/FILEUPLOAD-330
44e7080 is described below

commit 44e7080b1854976f720a270025c0f99a012f66da
Author: Arturo Bernal 
AuthorDate: Thu May 6 08:11:05 2021 +0200

FILEUPLOAD-330 -  Add taglist-maven-plugin
---
 pom.xml | 45 +
 1 file changed, 45 insertions(+)

diff --git a/pom.xml b/pom.xml
index 2a4816f..cf6f43b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -416,6 +416,51 @@
   
 
   
+  
+org.codehaus.mojo
+taglist-maven-plugin
+2.4
+
+  
+
+  
+Needs Work
+
+  
+TODO
+exact
+  
+  
+FIXME
+exact
+  
+  
+XXX
+exact
+  
+
+  
+  
+Noteable Markers
+
+  
+NOTE
+exact
+  
+  
+NOPMD
+exact
+  
+  
+NOSONAR
+exact
+  
+
+  
+
+  
+
+  
 
   
 


[commons-fileupload] branch master updated: FILEUPLOAD-328 - Switch from Cobertura code coverage to Jacoco code coverage

2021-05-05 Thread jochen
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 5cfdf5d  FILEUPLOAD-328 - Switch from Cobertura code coverage to 
Jacoco code coverage
 new 3095f87  Merge pull request #81 from 
arturobernalg/feature/FILEUPLOAD-328
5cfdf5d is described below

commit 5cfdf5d260f0496de1c1bafe417494b212ab6c79
Author: Arturo Bernal 
AuthorDate: Wed May 5 07:49:05 2021 +0200

FILEUPLOAD-328 - Switch from Cobertura code coverage to Jacoco code coverage
---
 src/site/resources/profile.cobertura |  2 --
 src/site/resources/profile.jacoco| 17 +
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/site/resources/profile.cobertura 
b/src/site/resources/profile.cobertura
deleted file mode 100644
index f2074df..000
--- a/src/site/resources/profile.cobertura
+++ /dev/null
@@ -1,2 +0,0 @@
-# This file is intentionally empty. It is only used, because its
-# presence activates the generation of a Coberturta report.
diff --git a/src/site/resources/profile.jacoco 
b/src/site/resources/profile.jacoco
new file mode 100644
index 000..a12755f
--- /dev/null
+++ b/src/site/resources/profile.jacoco
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -
+#
+# Empty file used to automatically trigger JaCoCo profile from commons parent 
pom


[commons-fileupload] branch master updated: FILEUPLOAD-327 - Solve SpotBug warning/errors

2021-05-02 Thread jochen
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 1c732d7  FILEUPLOAD-327 - Solve SpotBug warning/errors
 new b27fca2  Merge pull request #79 from 
arturobernalg/feature/FILEUPLOAD-327
1c732d7 is described below

commit 1c732d7ed34fa025327eeb6a2f3b7a6647d408a7
Author: Arturo Bernal 
AuthorDate: Sat May 1 19:36:43 2021 +0200

FILEUPLOAD-327 - Solve SpotBug warning/errors
---
 spotbugs-exclude-filter.xml  | 9 -
 .../java/org/apache/commons/fileupload2/ParameterParser.java | 2 +-
 .../java/org/apache/commons/fileupload2/disk/DiskFileItem.java   | 9 -
 3 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/spotbugs-exclude-filter.xml b/spotbugs-exclude-filter.xml
index e680028..1ad2747 100644
--- a/spotbugs-exclude-filter.xml
+++ b/spotbugs-exclude-filter.xml
@@ -33,20 +33,11 @@
 
 
 
-
-
-
-
-
 
 
 
 
 
-
-
-
-
 
 
 
diff --git a/src/main/java/org/apache/commons/fileupload2/ParameterParser.java 
b/src/main/java/org/apache/commons/fileupload2/ParameterParser.java
index 929da80..22f2328 100644
--- a/src/main/java/org/apache/commons/fileupload2/ParameterParser.java
+++ b/src/main/java/org/apache/commons/fileupload2/ParameterParser.java
@@ -299,7 +299,7 @@ public class ParameterParser {
 return new HashMap<>();
 }
 final HashMap params = new HashMap<>();
-this.chars = charArray;
+this.chars = charArray.clone();
 this.pos = offset;
 this.len = length;
 
diff --git 
a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java 
b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
index 688ec9b..fd4b0dc 100644
--- a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
@@ -305,7 +305,7 @@ public class DiskFileItem
 if (cachedContent == null && dfos != null) {
 cachedContent = dfos.getData();
 }
-return cachedContent;
+return cachedContent != null ? cachedContent.clone() : new byte[0];
 }
 
 byte[] fileData = new byte[(int) getSize()];
@@ -347,16 +347,15 @@ public class DiskFileItem
  */
 @Override
 public String getString() {
-byte[] rawdata = new byte[0];
 try {
-rawdata = get();
+byte[] rawData = get();
 String charset = getCharSet();
 if (charset == null) {
 charset = defaultCharset;
 }
-return new String(rawdata, charset);
+return new String(rawData, charset);
 } catch (final IOException e) {
-return new String(rawdata);
+return new String(new byte[0]);
 }
 }
 


[commons-fileupload] branch master updated: FILEUPLOAD-326 - Simplify Assertion

2021-05-01 Thread jochen
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 95c77d5  FILEUPLOAD-326 - Simplify Assertion
 new 32eade4  Merge pull request #77 from 
arturobernalg/feature/FILEUPLOAD-326
95c77d5 is described below

commit 95c77d5eac4c228d648d30c4ea0c31561306aa69
Author: Arturo Bernal 
AuthorDate: Sat May 1 11:08:03 2021 +0200

FILEUPLOAD-326 - Simplify Assertion
---
 .../org/apache/commons/fileupload2/DefaultFileItemTest.java  |  6 +++---
 .../org/apache/commons/fileupload2/ParameterParserTest.java  | 12 ++--
 .../org/apache/commons/fileupload2/ProgressListenerTest.java |  1 +
 .../java/org/apache/commons/fileupload2/StreamingTest.java   |  5 +++--
 4 files changed, 13 insertions(+), 11 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java 
b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
index 3f4999a..8046fd0 100644
--- a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.fileupload2;
 
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -27,7 +28,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UncheckedIOException;
-import java.util.Arrays;
 import org.apache.commons.io.FileUtils;
 
 
@@ -126,7 +126,7 @@ public class DefaultFileItemTest {
 assertTrue(item.isInMemory());
 assertEquals(item.getSize(), testFieldValueBytes.length);
 try {
-assertTrue(Arrays.equals(item.get(), testFieldValueBytes));
+assertArrayEquals(item.get(), testFieldValueBytes);
 } catch (UncheckedIOException e) {
 fail("Unexpected IOException", e);
 }
@@ -189,7 +189,7 @@ public class DefaultFileItemTest {
 assertFalse(item.isInMemory());
 assertEquals(item.getSize(), testFieldValueBytes.length);
 try {
-assertTrue(Arrays.equals(item.get(), testFieldValueBytes));
+assertArrayEquals(item.get(), testFieldValueBytes);
 } catch (UncheckedIOException e) {
 fail("Unexpected IOException", e);
 }
diff --git 
a/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java 
b/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
index 6ba6ba0..4728457 100644
--- a/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
@@ -35,27 +35,27 @@ public class ParameterParserTest {
 "test; test1 =  stuff   ; test2 =  \"stuff; stuff\"; 
test3=\"stuff";
 final ParameterParser parser = new ParameterParser();
 Map params = parser.parse(s, ';');
-assertEquals(null, params.get("test"));
+assertNull(params.get("test"));
 assertEquals("stuff", params.get("test1"));
 assertEquals("stuff; stuff", params.get("test2"));
 assertEquals("\"stuff", params.get("test3"));
 
 params = parser.parse(s, new char[] { ',', ';' });
-assertEquals(null, params.get("test"));
+assertNull(params.get("test"));
 assertEquals("stuff", params.get("test1"));
 assertEquals("stuff; stuff", params.get("test2"));
 assertEquals("\"stuff", params.get("test3"));
 
 s = "  test  , test1=stuff   ,  , test2=, test3, ";
 params = parser.parse(s, ',');
-assertEquals(null, params.get("test"));
+assertNull(params.get("test"));
 assertEquals("stuff", params.get("test1"));
-assertEquals(null, params.get("test2"));
-assertEquals(null, params.get("test3"));
+assertNull(params.get("test2"));
+assertNull(params.get("test3"));
 
 s = "  test";
 params = parser.parse(s, ';');
-assertEquals(null, params.get("test"));
+assertNull(params.get("test"));
 
 s = "  ";
 params = parser.parse(s, ';');
diff --git 
a/src/test/java/org/apache/commons/fileupload2/ProgressListenerTest.java 
b/src/test/java/org/apache/commons/fileupload2/ProgressListenerTest.java
index 02809a5..351c143 100644
--- a/s

[commons-fileupload] branch master updated: Exclude DLS_DEAD_LOCAL_STORE what i think it's a false positive.

2021-05-01 Thread jochen
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 5c2a44f   Exclude DLS_DEAD_LOCAL_STORE  what i think it's a false 
positive.
 new a4186a0  Merge pull request #78 from 
arturobernalg/feature/exlude_spotbug
5c2a44f is described below

commit 5c2a44fb9ce53a9a3c18b6e13bf92f92a00e0c19
Author: Arturo Bernal 
AuthorDate: Sat May 1 11:58:12 2021 +0200

 Exclude DLS_DEAD_LOCAL_STORE  what i think it's a false positive.
---
 spotbugs-exclude-filter.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/spotbugs-exclude-filter.xml b/spotbugs-exclude-filter.xml
index e680028..e3afa5d 100644
--- a/spotbugs-exclude-filter.xml
+++ b/spotbugs-exclude-filter.xml
@@ -50,6 +50,11 @@
 
 
 
+
+
+
+
+
 
 
 


[commons-fileupload] branch master updated: FILEUPLOAD-325 - Remove Unused Assignment

2021-05-01 Thread jochen
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 ca45aa7  FILEUPLOAD-325 - Remove Unused Assignment
 new 1ac8c61  Merge pull request #76 from 
arturobernalg/feature/FILEUPLOAD-325
ca45aa7 is described below

commit ca45aa7174c1289411dc4371183411e3d2ec5fbf
Author: Arturo Bernal 
AuthorDate: Sat May 1 11:03:43 2021 +0200

FILEUPLOAD-325 - Remove Unused Assignment
---
 src/main/java/org/apache/commons/fileupload2/MultipartStream.java | 4 ++--
 src/main/java/org/apache/commons/fileupload2/ParameterParser.java | 4 ++--
 .../java/org/apache/commons/fileupload2/MockHttpServletRequest.java   | 2 +-
 .../apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/MultipartStream.java 
b/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
index 3011628..e7ff716 100644
--- a/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
+++ b/src/main/java/org/apache/commons/fileupload2/MultipartStream.java
@@ -451,7 +451,7 @@ public class MultipartStream {
 public boolean readBoundary()
 throws FileUploadIOException, MalformedStreamException {
 final byte[] marker = new byte[2];
-boolean nextChunk = false;
+boolean nextChunk;
 
 head += boundaryLength;
 try {
@@ -582,7 +582,7 @@ public class MultipartStream {
 baos.write(b);
 }
 
-String headers = null;
+String headers;
 if (headerEncoding != null) {
 try {
 headers = baos.toString(headerEncoding);
diff --git a/src/main/java/org/apache/commons/fileupload2/ParameterParser.java 
b/src/main/java/org/apache/commons/fileupload2/ParameterParser.java
index 04e7fd0..929da80 100644
--- a/src/main/java/org/apache/commons/fileupload2/ParameterParser.java
+++ b/src/main/java/org/apache/commons/fileupload2/ParameterParser.java
@@ -303,8 +303,8 @@ public class ParameterParser {
 this.pos = offset;
 this.len = length;
 
-String paramName = null;
-String paramValue = null;
+String paramName;
+String paramValue;
 while (hasChar()) {
 paramName = parseToken(new char[] {
 '=', separator });
diff --git 
a/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java 
b/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
index 0a69b54..b397941 100644
--- a/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
+++ b/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
@@ -310,7 +310,7 @@ public class MockHttpServletRequest implements 
HttpServletRequest {
  */
 @Override
 public int getContentLength() {
-int iLength = 0;
+int iLength;
 
 if (null == m_requestData) {
 iLength = -1;
diff --git 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
 
b/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
index 02b658b..1bf1f05 100644
--- 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
+++ 
b/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
@@ -324,7 +324,7 @@ public class MockJakSrvltHttpRequest implements 
HttpServletRequest {
  */
 @Override
 public int getContentLength() {
-int iLength = 0;
+int iLength;
 
 if (null == m_requestData) {
 iLength = -1;


[commons-fileupload] branch master updated (849ae27 -> 68dbfbc)

2021-04-30 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 849ae27  Merge pull request #75 from 
arturobernalg/feature/FILEUPLOAD-323
 new b3676bb  FILEUPLOAD-318 - Use try with resource
 new b33dda7  Fix test
 new 68dbfbc  Merge pull request #69 from 
arturobernalg/feature/FILEUPLOAD-318

The 1105 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/commons/fileupload2/FileItem.java   |  8 +++-
 .../commons/fileupload2/disk/DiskFileItem.java | 46 ++
 .../apache/commons/fileupload2/util/Streams.java   | 13 +-
 .../commons/fileupload2/DefaultFileItemTest.java   | 14 ++-
 .../fileupload2/DiskFileItemSerializeTest.java | 13 +-
 5 files changed, 51 insertions(+), 43 deletions(-)


[commons-fileupload] branch master updated: FILEUPLOAD-323 - Implement spotbugs

2021-04-30 Thread jochen
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 92386e2  FILEUPLOAD-323 - Implement spotbugs
 new 849ae27  Merge pull request #75 from 
arturobernalg/feature/FILEUPLOAD-323
92386e2 is described below

commit 92386e20c4f0bed4a2e2781390d63a0685f1760b
Author: Arturo Bernal 
AuthorDate: Thu Apr 29 21:33:43 2021 +0200

FILEUPLOAD-323 - Implement spotbugs
---
 .github/workflows/maven.yml |  2 +-
 pom.xml | 19 +-
 spotbugs-exclude-filter.xml | 61 +
 3 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 048732b..44c5f95 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -44,4 +44,4 @@ jobs:
 distribution: 'adopt'
 java-version: ${{ matrix.java }}
 - name: Build with Maven
-  run: mvn -V package --file pom.xml --no-transfer-progress
+  run: mvn -V package --file pom.xml --no-transfer-progress spotbugs:check
diff --git a/pom.xml b/pom.xml
index 43e2215..2a4816f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -232,6 +232,8 @@
 
scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}
 Rob Tompkins
 
B6E73D84EA4FCC47166087253FAAD2CD5ECBB314
+4.2.3
+4.2.3
   
 
   
@@ -357,7 +359,7 @@
 
   
 
-clean verify apache-rat:check clirr:check 
javadoc:javadoc
+clean verify apache-rat:check clirr:check javadoc:javadoc 
spotbugs:check
   
 
   
@@ -458,6 +460,21 @@
   
 
   
+  
+com.github.spotbugs
+spotbugs-maven-plugin
+${spotbugs.plugin.version}
+
+  
+com.github.spotbugs
+spotbugs
+${spotbugs.impl.version}
+  
+
+
+  
${basedir}/spotbugs-exclude-filter.xml
+
+  
 
   
 
diff --git a/spotbugs-exclude-filter.xml b/spotbugs-exclude-filter.xml
new file mode 100644
index 000..e680028
--- /dev/null
+++ b/spotbugs-exclude-filter.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


[commons-fileupload] branch master updated: FILEUPLOAD-322 - Update Copyright

2021-04-27 Thread jochen
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 a16a10f  FILEUPLOAD-322 - Update Copyright
 new d863336  Merge pull request #74 from 
arturobernalg/feature/FILEUPLOAD-322
a16a10f is described below

commit a16a10fcec1a6f75fe172c67a96dffa1d49b4f1d
Author: Arturo Bernal 
AuthorDate: Tue Apr 27 21:20:50 2021 +0200

FILEUPLOAD-322 - Update Copyright
---
 NOTICE.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NOTICE.txt b/NOTICE.txt
index 84a0664..393c954 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
 Apache Commons FileUpload
-Copyright 2002-2019 The Apache Software Foundation
+Copyright 2002-2021 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).


[commons-fileupload] branch master updated: FILEUPLOAD-320 - Use charset constant int the test V1

2021-04-27 Thread jochen
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 7be9057  FILEUPLOAD-320 - Use charset constant int the test V1
 new d2dbb56  Merge pull request #73 from 
arturobernalg/feature/FILEUPLOAD-320
7be9057 is described below

commit 7be9057fd5939923923417c66c7195cb80976d95
Author: Arturo Bernal 
AuthorDate: Sun Apr 25 15:28:15 2021 +0200

FILEUPLOAD-320 - Use charset constant int the test V1
---
 .../java/org/apache/commons/fileupload2/DiskFileUploadTest.java  | 3 ++-
 src/test/java/org/apache/commons/fileupload2/FileUploadTest.java | 3 ++-
 .../commons/fileupload2/jaksrvlt/JakSrvltFileUploadTest.java | 9 +
 .../commons/fileupload2/portlet/PortletFileUploadTest.java   | 3 ++-
 .../commons/fileupload2/util/mime/Base64DecoderTestCase.java | 9 +
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java 
b/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java
index a4ba6ca..19c753b 100644
--- a/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/DiskFileUploadTest.java
@@ -19,6 +19,7 @@ package org.apache.commons.fileupload2;
 import static org.junit.jupiter.api.Assertions.*;
 
 import java.io.File;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
@@ -84,7 +85,7 @@ public class DiskFileUploadTest {
 "This is the content of the file\n" +
 "\r\n" +
 "-1234--\r\n";
-   final byte[] contentBytes = content.getBytes("US-ASCII");
+   final byte[] contentBytes = content.getBytes(StandardCharsets.US_ASCII);
 final HttpServletRequest request = new 
MockHttpServletRequest(contentBytes, Constants.CONTENT_TYPE);
 final List items = myUpload.parseRequest(request);
 assertNotNull(items);
diff --git a/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java 
b/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java
index 65b583a..eef8b39 100644
--- a/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java
@@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.stream.Stream;
 
@@ -220,7 +221,7 @@ public class FileUploadTest {
 "...contents of file2.gif...\r\n" +
 "--BbC04y--\r\n" +
 "--AaB03x--";
-final List fileItems = Util.parseUpload(upload, 
request.getBytes("US-ASCII"), contentType);
+final List fileItems = Util.parseUpload(upload, 
request.getBytes(StandardCharsets.US_ASCII), contentType);
 assertEquals(3, fileItems.size());
 final FileItem item0 = fileItems.get(0);
 assertEquals("field1", item0.getFieldName());
diff --git 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUploadTest.java
 
b/src/test/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUploadTest.java
index e1b52a7..066652c 100644
--- 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUploadTest.java
+++ 
b/src/test/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUploadTest.java
@@ -19,6 +19,7 @@ package org.apache.commons.fileupload2.jaksrvlt;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.Map;
 
@@ -63,7 +64,7 @@ public class JakSrvltFileUploadTest {
   "\r\n" +
   "value2\r\n" +
   "-1234--\r\n";
-final byte[] bytes = text.getBytes("US-ASCII");
+final byte[] bytes = text.getBytes(StandardCharsets.US_ASCII);
 final HttpServletRequest request = new MockJakSrvltHttpRequest(bytes, 
Constants.CONTENT_TYPE);
 
 final JakSrvltFileUpload upload = new JakSrvltFileUpload(new 
DiskFileItemFactory());
@@ -86,11 +87,11 @@ public class JakSrvltFileUploadTest {
 final String text = "-1234\r\n" +
 "Content-Disposition: form-data; name=\"utf8Html\"\r\n" +
 "\r\n" +
-"Th�s �s the co�te�t of the f�le\n" +
+"Thís ís the coñteñt of the fíle\n" +
 "\r\n" +
 "-1234

[commons-fileupload] branch master updated: FILEUPLOAD-321 - Use charset constant int the test V2

2021-04-26 Thread jochen
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 1b10014  FILEUPLOAD-321 - Use charset constant int the test V2
 new 5d3e1d8  Merge pull request #72 from 
arturobernalg/feature/FILEUPLOAD-321
1b10014 is described below

commit 1b10014dddf12527f8dbad24169e4f6a9434e8c5
Author: Arturo Bernal 
AuthorDate: Sun Apr 25 15:29:19 2021 +0200

FILEUPLOAD-321 - Use charset constant int the test V2
---
 .../commons/fileupload2/ProgressListenerTest.java  |  7 +++---
 .../org/apache/commons/fileupload2/SizesTest.java  | 25 +++---
 .../apache/commons/fileupload2/StreamingTest.java  |  7 +++---
 .../java/org/apache/commons/fileupload2/Util.java  |  3 ++-
 .../fileupload2/servlet/ServletFileUploadTest.java |  9 
 .../util/mime/QuotedPrintableDecoderTestCase.java  |  7 +++---
 6 files changed, 32 insertions(+), 26 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/fileupload2/ProgressListenerTest.java 
b/src/test/java/org/apache/commons/fileupload2/ProgressListenerTest.java
index 70c35c4..02809a5 100644
--- a/src/test/java/org/apache/commons/fileupload2/ProgressListenerTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/ProgressListenerTest.java
@@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.fail;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.commons.fileupload2.servlet.ServletFileUpload;
 import org.junit.jupiter.api.Test;
@@ -77,13 +78,13 @@ public class ProgressListenerTest {
 final String header = "-1234\r\n"
 + "Content-Disposition: form-data; name=\"field" + (i+1) + 
"\"\r\n"
 + "\r\n";
-baos.write(header.getBytes("US-ASCII"));
+baos.write(header.getBytes(StandardCharsets.US_ASCII));
 for (int j = 0;  j < 16384+i;  j++) {
 baos.write((byte) j);
 }
-baos.write("\r\n".getBytes("US-ASCII"));
+baos.write("\r\n".getBytes(StandardCharsets.US_ASCII));
 }
-baos.write("-1234--\r\n".getBytes("US-ASCII"));
+baos.write("-1234--\r\n".getBytes(StandardCharsets.US_ASCII));
 final byte[] contents = baos.toByteArray();
 
 MockHttpServletRequest request = new MockHttpServletRequest(contents, 
Constants.CONTENT_TYPE);
diff --git a/src/test/java/org/apache/commons/fileupload2/SizesTest.java 
b/src/test/java/org/apache/commons/fileupload2/SizesTest.java
index 80998a1..a254f34 100644
--- a/src/test/java/org/apache/commons/fileupload2/SizesTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/SizesTest.java
@@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.fail;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Iterator;
 import java.util.List;
 
@@ -58,13 +59,13 @@ public class SizesTest {
 final String header = "-1234\r\n"
 + "Content-Disposition: form-data; name=\"field" + (num++) + 
"\"\r\n"
 + "\r\n";
-baos.write(header.getBytes("US-ASCII"));
+baos.write(header.getBytes(StandardCharsets.US_ASCII));
 for (int j = 0;  j < i;  j++) {
 baos.write((byte) j);
 }
-baos.write("\r\n".getBytes("US-ASCII"));
+baos.write("\r\n".getBytes(StandardCharsets.US_ASCII));
 }
-baos.write("-1234--\r\n".getBytes("US-ASCII"));
+baos.write("-1234--\r\n".getBytes(StandardCharsets.US_ASCII));
 
 final List fileItems =
 Util.parseUpload(new ServletFileUpload(new 
DiskFileItemFactory()), baos.toByteArray());
@@ -103,7 +104,7 @@ public class SizesTest {
 ServletFileUpload upload = new ServletFileUpload(new 
DiskFileItemFactory());
 upload.setFileSizeMax(-1);
 HttpServletRequest req = new MockHttpServletRequest(
-request.getBytes("US-ASCII"), Constants.CONTENT_TYPE);
+request.getBytes(StandardCharsets.US_ASCII), 
Constants.CONTENT_TYPE);
 List fileItems = upload.parseRequest(req);
 assertEquals(1, fileItems.size());
 FileItem item = fileItems.get(0);
@@ -111,7 +112,7 @@ public class SizesTest {
 
 upload = new ServletFileUpload(new DiskFileItemFactory());
 upload.setFileSizeMax(40);
-req = new MockHttpServletRequest(

[commons-fileupload] branch master updated: FILEUPLOAD-314 - Replace C-style array declaration for java

2021-04-26 Thread jochen
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 0635758  FILEUPLOAD-314 - Replace C-style array declaration for java
 new e25b708  Merge pull request #62 from 
arturobernalg/feature/FILEUPLOAD-314
0635758 is described below

commit 06357585199fe659d9cc4914d04279bb6d5d18ec
Author: Arturo Bernal 
AuthorDate: Thu Apr 22 20:21:07 2021 +0200

FILEUPLOAD-314 - Replace C-style array declaration for java
---
 pom.xml|  4 
 .../apache/commons/fileupload2/DefaultFileItemTest.java| 14 +++---
 .../apache/commons/fileupload2/MockHttpServletRequest.java |  2 +-
 .../java/org/apache/commons/fileupload2/StreamingTest.java |  2 +-
 .../fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java  |  2 +-
 5 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7520276..0dfa165 100644
--- a/pom.xml
+++ b/pom.xml
@@ -183,6 +183,10 @@
   Merbin J Anselm
   merbinjans...@gmail.com
 
+
+  Arturo Bernal
+  arturobern...@gmail.com
+
   
 
   
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java 
b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
index 5a458e4..dd2d09b 100644
--- a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
@@ -222,36 +222,36 @@ public class DefaultFileItemTest {
 
 static final String CHARSET_WIN1251 = "Cp1251";
 
-static final int SWISS_GERMAN_STUFF_UNICODE [] = {
+static final int[] SWISS_GERMAN_STUFF_UNICODE = {
 0x47, 0x72, 0xFC, 0x65, 0x7A, 0x69, 0x5F, 0x7A, 0xE4, 0x6D, 0xE4
 };
 
-static final int SWISS_GERMAN_STUFF_ISO8859_1 [] = {
+static final int[] SWISS_GERMAN_STUFF_ISO8859_1 = {
 0x47, 0x72, 0xFC, 0x65, 0x7A, 0x69, 0x5F, 0x7A, 0xE4, 0x6D, 0xE4
 };
 
-static final int SWISS_GERMAN_STUFF_UTF8 [] = {
+static final int[] SWISS_GERMAN_STUFF_UTF8 = {
 0x47, 0x72, 0xC3, 0xBC, 0x65, 0x7A, 0x69, 0x5F, 0x7A, 0xC3, 0xA4,
 0x6D, 0xC3, 0xA4
 };
 
-static final int RUSSIAN_STUFF_UNICODE [] = {
+static final int[] RUSSIAN_STUFF_UNICODE = {
 0x412, 0x441, 0x435, 0x43C, 0x5F, 0x43F, 0x440, 0x438,
 0x432, 0x435, 0x442
 };
 
-static final int RUSSIAN_STUFF_UTF8 [] = {
+static final int[] RUSSIAN_STUFF_UTF8 = {
 0xD0, 0x92, 0xD1, 0x81, 0xD0, 0xB5, 0xD0, 0xBC, 0x5F,
 0xD0, 0xBF, 0xD1, 0x80, 0xD0, 0xB8, 0xD0, 0xB2, 0xD0,
 0xB5, 0xD1, 0x82
 };
 
-static final int RUSSIAN_STUFF_KOI8R [] = {
+static final int[] RUSSIAN_STUFF_KOI8R = {
 0xF7, 0xD3, 0xC5, 0xCD, 0x5F, 0xD0, 0xD2, 0xC9, 0xD7,
 0xC5, 0xD4
 };
 
-static final int RUSSIAN_STUFF_WIN1251 [] = {
+static final int[] RUSSIAN_STUFF_WIN1251 = {
 0xC2, 0xF1, 0xE5, 0xEC, 0x5F, 0xEF, 0xF0, 0xE8, 0xE2,
 0xE5, 0xF2
 };
diff --git 
a/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java 
b/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
index 71a4643..29a949f 100644
--- a/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
+++ b/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
@@ -557,7 +557,7 @@ public class MockHttpServletRequest implements 
HttpServletRequest {
 }
 
 @Override
-public int read(final byte b[], final int off, final int len) throws 
IOException {
+public int read(final byte[] b, final int off, final int len) throws 
IOException {
 if (readLimit > 0) {
 return in.read(b, off, Math.min(readLimit, len));
 }
diff --git a/src/test/java/org/apache/commons/fileupload2/StreamingTest.java 
b/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
index cfe04a8..79af396 100644
--- a/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
@@ -139,7 +139,7 @@ public class StreamingTest {
 return bais.read();
 }
 @Override
-public int read(final byte b[], final int off, final int len) 
throws IOException
+public int read(final byte[] b, final int off, final int len) 
throws IOException
 {
 return bais.read(b, off, Math.min(len, 3));
 }
diff --git 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
 
b/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
index b863c5b..c564ed8 100644
--- 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
++

[commons-fileupload] branch master updated: FILEUPLOAD-315 - java8 improvement:

2021-04-26 Thread jochen
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 f2fa3c4  FILEUPLOAD-315 - java8 improvement:
 new 6642724  Merge pull request #65 from 
arturobernalg/feature/FILEUPLOAD-315
f2fa3c4 is described below

commit f2fa3c4b49493048dbc7b73fe568e6884550fa60
Author: Arturo Bernal 
AuthorDate: Fri Apr 23 07:10:38 2021 +0200

FILEUPLOAD-315 - java8 improvement:

* Use computeIfAbsent
---
 src/main/java/org/apache/commons/fileupload2/FileUploadBase.java   | 7 +--
 .../org/apache/commons/fileupload2/util/FileItemHeadersImpl.java   | 6 +-
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java 
b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index f0d6582..3bb610b 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -386,12 +386,7 @@ public abstract class FileUploadBase {
 
 for (final FileItem fileItem : items) {
 final String fieldName = fileItem.getFieldName();
-List mappedItems = itemsMap.get(fieldName);
-
-if (mappedItems == null) {
-mappedItems = new ArrayList<>();
-itemsMap.put(fieldName, mappedItems);
-}
+List mappedItems = itemsMap.computeIfAbsent(fieldName, k 
-> new ArrayList<>());
 
 mappedItems.add(fileItem);
 }
diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/FileItemHeadersImpl.java 
b/src/main/java/org/apache/commons/fileupload2/util/FileItemHeadersImpl.java
index 06fdf60..2c237a7 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/FileItemHeadersImpl.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/FileItemHeadersImpl.java
@@ -87,11 +87,7 @@ public class FileItemHeadersImpl implements FileItemHeaders, 
Serializable {
  */
 public synchronized void addHeader(final String name, final String value) {
 final String nameLower = name.toLowerCase(Locale.ENGLISH);
-List headerValueList = headerNameToValueListMap.get(nameLower);
-if (null == headerValueList) {
-headerValueList = new ArrayList<>();
-headerNameToValueListMap.put(nameLower, headerValueList);
-}
+List headerValueList = 
headerNameToValueListMap.computeIfAbsent(nameLower, k -> new ArrayList<>());
 headerValueList.add(value);
 }
 


[commons-fileupload] branch master updated: FILEUPLOAD-312 - Use charset constant

2021-04-26 Thread jochen
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 149d38d  FILEUPLOAD-312 - Use charset constant
 new 5b4060f  Merge pull request #64 from 
arturobernalg/feature/FILEUPLOAD-312
149d38d is described below

commit 149d38d7c1ff0e9f934774c7ad29eba0667d0d8a
Author: Arturo Bernal 
AuthorDate: Fri Apr 23 07:02:51 2021 +0200

FILEUPLOAD-312 - Use charset constant
---
 src/main/java/org/apache/commons/fileupload2/FileUploadBase.java  | 8 ++--
 .../org/apache/commons/fileupload2/util/mime/MimeUtility.java | 8 ++--
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java 
b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index ef93788..53682a9 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -19,7 +19,7 @@ package org.apache.commons.fileupload2;
 import static java.lang.String.format;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -423,11 +423,7 @@ public abstract class FileUploadBase {
 return null;
 }
 byte[] boundary;
-try {
-boundary = boundaryStr.getBytes("ISO-8859-1");
-} catch (final UnsupportedEncodingException e) {
-boundary = boundaryStr.getBytes(); // Intentionally falls back to 
default charset
-}
+boundary = boundaryStr.getBytes(StandardCharsets.ISO_8859_1);
 return boundary;
 }
 
diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java 
b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
index af0f06b..5a0d322 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
@@ -19,6 +19,7 @@ package org.apache.commons.fileupload2.util.mime;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -31,11 +32,6 @@ import java.util.Map;
 public final class MimeUtility {
 
 /**
- * The {@code US-ASCII} charset identifier constant.
- */
-private static final String US_ASCII_CHARSET = "US-ASCII";
-
-/**
  * The marker to indicate text is encoded with BASE64 algorithm.
  */
 private static final String BASE64_ENCODING_MARKER = "B";
@@ -237,7 +233,7 @@ public final class MimeUtility {
 // the decoder writes directly to an output stream.
 final ByteArrayOutputStream out = new 
ByteArrayOutputStream(encodedText.length());
 
-final byte[] encodedData = encodedText.getBytes(US_ASCII_CHARSET);
+final byte[] encodedData = 
encodedText.getBytes(StandardCharsets.US_ASCII);
 
 // Base64 encoded?
 if (encoding.equals(BASE64_ENCODING_MARKER)) {


[commons-fileupload] 01/01: Merge pull request #66 from apache/dependabot/github_actions/actions/cache-v2.1.5

2021-04-24 Thread jochen
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

commit ee6493a473e242f6082c0388df02f9878ef331a7
Merge: a27bfc5 1e5b6ab
Author: Jochen Wiedmann 
AuthorDate: Sat Apr 24 13:23:25 2021 +0200

Merge pull request #66 from 
apache/dependabot/github_actions/actions/cache-v2.1.5

Bump actions/cache from v2.1.4 to v2.1.5

 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated (a27bfc5 -> ee6493a)

2021-04-24 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from a27bfc5  Merge pull request #68 from 
arturobernalg/feature/FILEUPLOAD-317
 add 1e5b6ab  Bump actions/cache from v2.1.4 to v2.1.5
 new ee6493a  Merge pull request #66 from 
apache/dependabot/github_actions/actions/cache-v2.1.5

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated: FILEUPLOAD-317 - Fix javadoc: Complete missing javadoc

2021-04-24 Thread jochen
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 1622178  FILEUPLOAD-317  - Fix javadoc: Complete missing javadoc
 new a27bfc5  Merge pull request #68 from 
arturobernalg/feature/FILEUPLOAD-317
1622178 is described below

commit 1622178f71718b81ef18e729682bc2ccd468b838
Author: Arturo Bernal 
AuthorDate: Fri Apr 23 10:06:42 2021 +0200

FILEUPLOAD-317  - Fix javadoc: Complete missing javadoc
---
 .../java/org/apache/commons/fileupload2/util/mime/MimeUtility.java| 4 ++--
 .../apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java 
b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
index af0f06b..8b36aea 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
@@ -193,8 +193,8 @@ public final class MimeUtility {
  * @param word   The possibly encoded word value.
  *
  * @return The decoded word.
- * @throws ParseException
- * @throws UnsupportedEncodingException
+ * @throws ParseException in case of a parse error of the RFC 2047
+ * @throws UnsupportedEncodingException Thrown when Invalid RFC 2047 
encoding was found
  */
 private static String decodeWord(final String word) throws ParseException, 
UnsupportedEncodingException {
 // encoded words start with the characters "=?".  If this not an 
encoded word, we throw a
diff --git 
a/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
 
b/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
index 8aac120..34af14d 100644
--- 
a/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
+++ 
b/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
@@ -44,7 +44,7 @@ final class QuotedPrintableDecoder {
  * @param outThe output stream used to return the decoded data.
  *
  * @return the number of bytes produced.
- * @throws IOException
+ * @throws IOException if an IO error occurs
  */
 public static int decode(final byte[] data, final OutputStream out) throws 
IOException {
 int off = 0;


[commons-fileupload] branch master updated: FILEUPLOAD-311 - Replace construction of FileInputStream and FileOutputStream objects with Files NIO APIs.

2021-04-24 Thread jochen
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 4539ecb  FILEUPLOAD-311 - Replace construction of FileInputStream and 
FileOutputStream objects with Files NIO APIs.
 new b15a806  Merge pull request #59 from 
arturobernalg/feature/FILEUPLOAD-311
4539ecb is described below

commit 4539ecbd688a419cc17b5d8a77999ca7c825a007
Author: Arturo Bernal 
AuthorDate: Thu Apr 22 18:21:35 2021 +0200

FILEUPLOAD-311 - Replace construction of FileInputStream and 
FileOutputStream objects with Files NIO APIs.
---
 .../org/apache/commons/fileupload2/disk/DiskFileItem.java | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java 
b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
index c173dc6..1e5da6e 100644
--- a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
@@ -20,12 +20,11 @@ import static java.lang.String.format;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
+import java.nio.file.Files;
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -203,7 +202,7 @@ public class DiskFileItem
 public InputStream getInputStream()
 throws IOException {
 if (!isInMemory()) {
-return new FileInputStream(dfos.getFile());
+return Files.newInputStream(dfos.getFile().toPath());
 }
 
 if (cachedContent == null) {
@@ -310,7 +309,7 @@ public class DiskFileItem
 InputStream fis = null;
 
 try {
-fis = new FileInputStream(dfos.getFile());
+fis = Files.newInputStream(dfos.getFile().toPath());
 IOUtils.readFully(fis, fileData);
 } catch (final IOException e) {
 fileData = null;
@@ -385,9 +384,9 @@ public class DiskFileItem
 @Override
 public void write(final File file) throws Exception {
 if (isInMemory()) {
-FileOutputStream fout = null;
+OutputStream fout = null;
 try {
-fout = new FileOutputStream(file);
+fout = Files.newOutputStream(file.toPath());
 fout.write(get());
 fout.close();
 } finally {


[commons-fileupload] 01/01: Merge pull request #54 from apache/dependabot/maven/org.apache.maven.plugins-maven-checkstyle-plugin-3.1.2

2021-04-22 Thread jochen
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

commit 289acf537a5d6f3ea5149ff03c10ee33c1d4bded
Merge: 6a9f8bb 4ed7600
Author: Jochen Wiedmann 
AuthorDate: Thu Apr 22 23:00:52 2021 +0200

Merge pull request #54 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-checkstyle-plugin-3.1.2

Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[commons-fileupload] branch master updated (6a9f8bb -> 289acf5)

2021-04-22 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 6a9f8bb  Merge pull request #56 from 
apache/dependabot/github_actions/actions/cache-v2.1.4
 add 4ed7600  Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2
 new 289acf5  Merge pull request #54 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-checkstyle-plugin-3.1.2

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated (163a5e0 -> 6a9f8bb)

2021-04-22 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 163a5e0  Merge pull request #55 from 
apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.1
 add 97b14cf  Bump actions/cache from v2 to v2.1.4
 add 6a9f8bb  Merge pull request #56 from 
apache/dependabot/github_actions/actions/cache-v2.1.4

No new revisions were added by this update.

Summary of changes:
 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated (97df331 -> 163a5e0)

2021-04-22 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 97df331  Merge pull request #61 from 
arturobernalg/feature/FILEUPLOAD-313
 add 94757a7  Bump junit-jupiter from 5.7.0 to 5.7.1
 add 163a5e0  Merge pull request #55 from 
apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.1

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[commons-fileupload] branch master updated: FILEUPLOAD-313 - Remove redundant local variable

2021-04-22 Thread jochen
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 bc47cab  FILEUPLOAD-313 - Remove redundant local variable
 new 97df331  Merge pull request #61 from 
arturobernalg/feature/FILEUPLOAD-313
bc47cab is described below

commit bc47cab7e607dec3f966d192907ff9e74d4e2ed8
Author: Arturo Bernal 
AuthorDate: Thu Apr 22 20:12:27 2021 +0200

FILEUPLOAD-313 - Remove redundant local variable
---
 src/main/java/org/apache/commons/fileupload2/FileUploadBase.java | 5 +
 .../java/org/apache/commons/fileupload2/MockHttpServletRequest.java  | 3 +--
 src/test/java/org/apache/commons/fileupload2/StreamingTest.java  | 3 +--
 src/test/java/org/apache/commons/fileupload2/Util.java   | 3 +--
 .../apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java | 3 +--
 5 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java 
b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index ef93788..f0d6582 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -76,10 +76,7 @@ public abstract class FileUploadBase {
 if (contentType == null) {
 return false;
 }
-if (contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART)) {
-return true;
-}
-return false;
+return contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART);
 }
 
 /**
diff --git 
a/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java 
b/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
index 71a4643..fee89dc 100644
--- a/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
+++ b/src/test/java/org/apache/commons/fileupload2/MockHttpServletRequest.java
@@ -343,8 +343,7 @@ public class MockHttpServletRequest implements 
HttpServletRequest {
  */
 @Override
 public ServletInputStream getInputStream() throws IOException {
-final ServletInputStream sis = new MyServletInputStream(m_requestData, 
readLimit);
-return sis;
+return new MyServletInputStream(m_requestData, readLimit);
 }
 
 /**
diff --git a/src/test/java/org/apache/commons/fileupload2/StreamingTest.java 
b/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
index cfe04a8..93934e4 100644
--- a/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/StreamingTest.java
@@ -182,8 +182,7 @@ public class StreamingTest {
 final HttpServletRequest request = new MockHttpServletRequest(pStream,
 pLength, contentType);
 
-final List fileItems = upload.parseRequest(new 
ServletRequestContext(request));
-return fileItems;
+return upload.parseRequest(new ServletRequestContext(request));
 }
 
 private String getHeader(final String pField) {
diff --git a/src/test/java/org/apache/commons/fileupload2/Util.java 
b/src/test/java/org/apache/commons/fileupload2/Util.java
index d70938e..b644ce0 100644
--- a/src/test/java/org/apache/commons/fileupload2/Util.java
+++ b/src/test/java/org/apache/commons/fileupload2/Util.java
@@ -40,8 +40,7 @@ public class Util {
 
 public static List parseUpload(final FileUpload upload, final 
byte[] bytes, final String contentType) throws FileUploadException {
 final HttpServletRequest request = new MockHttpServletRequest(bytes, 
contentType);
-final List fileItems = upload.parseRequest(new 
ServletRequestContext(request));
-return fileItems;
+return upload.parseRequest(new ServletRequestContext(request));
 }
 
 public static List parseUpload(final FileUpload upload, final 
String content)
diff --git 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
 
b/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
index b863c5b..7df23a4 100644
--- 
a/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
+++ 
b/src/test/java/org/apache/commons/fileupload2/jaksrvlt/MockJakSrvltHttpRequest.java
@@ -357,8 +357,7 @@ public class MockJakSrvltHttpRequest implements 
HttpServletRequest {
  */
 @Override
 public ServletInputStream getInputStream() throws IOException {
-final ServletInputStream sis = new MyServletInputStream(m_requestData, 
readLimit);
-return sis;
+return (ServletInputStream) new MyServletInputStream(m_requestData, 
readLimit);
 }
 
 /**


[commons-io] branch master updated: IO-556: Protecting against regression.

2021-04-09 Thread jochen
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-io.git


The following commit(s) were added to refs/heads/master by this push:
 new fe7543e  IO-556: Protecting against regression.
fe7543e is described below

commit fe7543eee5cd4b2f9e78aa44c31031b68eba204d
Author: Jochen Wiedmann 
AuthorDate: Fri Apr 9 21:19:34 2021 +0200

IO-556: Protecting against regression.
---
 src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java 
b/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
index 559c111..ab1030b 100644
--- a/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
@@ -272,6 +272,9 @@ public class FilenameUtilsTestCase {
 assertEquals(null, 
FilenameUtils.normalize("g:2:3:4:5:6:7:8\\a\\b\\c.txt"));
 assertEquals(null, 
FilenameUtils.normalize("1:2:3:4:5:6:7:8\\a\\b\\c.txt"));
 assertEquals(null, FilenameUtils.normalize("1:2\\a\\b\\c.txt"));
+// IO-556
+assertEquals(null, FilenameUtils.normalize("//../foo"));
+assertEquals(null, FilenameUtils.normalize("..\\foo"));
 }
 
 /**


[commons-lang] branch master updated: Introducing @Nonnull, @Nullable, and the Objects class as a helper tool.

2021-02-06 Thread jochen
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-lang.git


The following commit(s) were added to refs/heads/master by this push:
 new 45e8395  Introducing @Nonnull, @Nullable, and the Objects class as a 
helper tool.
45e8395 is described below

commit 45e8395ec7a63f432ce8df03159ee5465b1380ca
Author: Jochen Wiedmann 
AuthorDate: Sat Feb 6 22:51:47 2021 +0100

Introducing @Nonnull, @Nullable, and the Objects class as a helper tool.
---
 pom.xml|   7 +-
 spotbugs-exclude-filter.xml|   8 +
 src/changes/changes.xml|   1 +
 .../org/apache/commons/lang3/function/Objects.java | 176 +
 .../apache/commons/lang3/function/ObjectsTest.java | 146 +
 5 files changed, 337 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f8524e8..5135e4c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -566,7 +566,12 @@
   ${jmh.version}
   test
 
-
+
+  com.google.code.findbugs
+  jsr305
+  3.0.2
+  provided
+
   
 
   
diff --git a/spotbugs-exclude-filter.xml b/spotbugs-exclude-filter.xml
index 8636890..be00732 100644
--- a/spotbugs-exclude-filter.xml
+++ b/spotbugs-exclude-filter.xml
@@ -153,4 +153,12 @@
 
 
   
+
+  
+  
+
+
+
+  
 
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1eca750..4908376 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -105,6 +105,7 @@ The  type attribute can be add,update,fix,remove.
 Processor.java: check enum equality with == instead of .equals() method 
#690.
 Bump junit-pioneer from 1.1.0 to 1.3.0 #702.
 Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2 
#705.
+Introduce the use of 
@Nonnull, and @Nullable, and the Objects class as a helper tool.
   
   
 Refine test output for FastDateParserTest
diff --git a/src/main/java/org/apache/commons/lang3/function/Objects.java 
b/src/main/java/org/apache/commons/lang3/function/Objects.java
new file mode 100755
index 000..02f7ddb
--- /dev/null
+++ b/src/main/java/org/apache/commons/lang3/function/Objects.java
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.lang3.function;
+
+import java.util.function.Supplier;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.apache.commons.lang3.ObjectUtils;
+
+
+/**
+ * This class provides some replacements for the corresponding methods in
+ * {@link Objects}. The replacements have the advantage, that they are properly
+ * annotated with {@link Nullable}, and/or {@link Nonnull}, so they let the
+ * compiler know, what their respective results are.
+ *
+ * The various {@code requireNonNull} methods are particularly handy, when
+ * dealing with external code, that a) doesn't support the {@link Nonnull}
+ * annotation, or if you know for other reasons, that an object is non-null.
+ * Take for example, a {@link java.util.Map map}, that you have filled with
+ * non-null values. So, in your opinion, the following should be perfectably
+ * valid code:
+ * 
+ *   final MapString,Object map = getMapOfNonNullValues();
+ *   final @Nonnull Object o = map.get("SomeKey");
+ * 
+ * However, if your Java compiler *does* null analysis, it will reject this
+ * example as invalid, because {@link java.util.Map#get(Object)} might return
+ * a null value. As a workaround, you can use this:
+ * 
+ *   import static org.apache.commons.lang3.function.Objects.requireNonNull;
+ *
+ *   final MapString,Object map = getMapOfNonNullValues();
+ *   final @Nonnull Object o = requireNonNull(map.get("SomeKey"));
+ * 
+ *
+ * This class is somewhat redundant with regards to {@link ObjectUtils}.
+ * For example, {@link #requireNonNull(Object, Object)} is almost equivalent
+ * with {@link ObjectUtils#defaultIfNull(Object, Object)}. However, it isn't
+ * quite the same, because the latter can, in fact, return null. The former
+ * can't, and the Java compiler confirms this.(An alternative to redundancy

[commons-fileupload] branch master updated: Minor Improvement:

2020-12-30 Thread jochen
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 386323c  Minor Improvement:
 new 3d9884c  Merge pull request #51 from 
arturobernalg/feature/minor_improvement1
386323c is described below

commit 386323c05f8321f37716f3e0667f24ff91621f47
Author: Arturo Bernal 
AuthorDate: Wed Dec 30 09:07:26 2020 +0100

Minor Improvement:

* Add final
* Remove Unused import
* Remove Unnecessary interface modifier
---
 src/main/java/org/apache/commons/fileupload2/FileItemStream.java | 2 +-
 .../org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java| 4 ++--
 .../java/org/apache/commons/fileupload2/DefaultFileItemTest.java | 5 -
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload2/FileItemStream.java 
b/src/main/java/org/apache/commons/fileupload2/FileItemStream.java
index e36a2fe..4b31185 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileItemStream.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileItemStream.java
@@ -40,7 +40,7 @@ public interface FileItemStream extends 
FileItemHeadersSupport {
  * {@link java.util.Iterator#hasNext()} has been invoked on the
  * iterator, which created the {@link FileItemStream}.
  */
-public static class ItemSkippedException extends IOException {
+class ItemSkippedException extends IOException {
 
 /**
  * The exceptions serial version UID, which is being used
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 482a196..be258bb 100644
--- 
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
+++ 
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
@@ -149,7 +149,7 @@ public class FileItemIteratorImpl implements 
FileItemIterator {
  : contentLengthInt;
  // CHECKSTYLE:ON
 
-InputStream input; // N.B. this is eventually closed in 
MultipartStream processing
+final InputStream input; // N.B. this is eventually closed in 
MultipartStream processing
 if (sizeMax >= 0) {
 if (requestSize != -1 && requestSize > sizeMax) {
 throw new SizeLimitExceededException(
@@ -218,7 +218,7 @@ public class FileItemIteratorImpl implements 
FileItemIterator {
 }
 final MultipartStream multi = getMultiPartStream();
 for (;;) {
-boolean nextPart;
+final boolean nextPart;
 if (skipPreamble) {
 nextPart = multi.skipPreamble();
 } else {
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java 
b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
index e1d5101..5a458e4 100644
--- a/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/DefaultFileItemTest.java
@@ -29,11 +29,6 @@ import java.io.OutputStream;
 import java.util.Arrays;
 import org.apache.commons.io.FileUtils;
 
-import org.apache.commons.fileupload2.DefaultFileItem;
-import org.apache.commons.fileupload2.DefaultFileItemFactory;
-import org.apache.commons.fileupload2.FileItem;
-import org.apache.commons.fileupload2.FileItemFactory;
-import org.apache.commons.io.FileUtils;
 
 import org.junit.jupiter.api.Test;
 



[commons-fileupload] 01/01: Merge pull request #47 from apache/dependabot/maven/commons-io-commons-io-2.8.0

2020-11-12 Thread jochen
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

commit 024a5de0789fc72ac63d9cec8824facf5b0a87ad
Merge: 98163a8 43ac01c
Author: Jochen Wiedmann 
AuthorDate: Thu Nov 12 22:36:39 2020 +0100

Merge pull request #47 from 
apache/dependabot/maven/commons-io-commons-io-2.8.0

Bump commons-io from 2.7 to 2.8.0

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)




[commons-fileupload] branch master updated (98163a8 -> 024a5de)

2020-11-12 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 98163a8  Merge pull request #46 from 
apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.0
 add 43ac01c  Bump commons-io from 2.7 to 2.8.0
 new 024a5de  Merge pull request #47 from 
apache/dependabot/maven/commons-io-commons-io-2.8.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[commons-fileupload] 01/01: Merge pull request #46 from apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.0

2020-11-12 Thread jochen
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

commit 98163a884e48c149d534af5eadeebd9cf9346c68
Merge: 53c8d88 e463b7f
Author: Jochen Wiedmann 
AuthorDate: Thu Nov 12 22:36:00 2020 +0100

Merge pull request #46 from 
apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.0

Bump junit-jupiter from 5.6.2 to 5.7.0

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[commons-fileupload] branch master updated (53c8d88 -> 98163a8)

2020-11-12 Thread jochen
This is an automated email from the ASF dual-hosted git repository.

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


from 53c8d88  Merge pull request #35 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-pmd-plugin-3.13.0
 add e463b7f  Bump junit-jupiter from 5.6.2 to 5.7.0
 new 98163a8  Merge pull request #46 from 
apache/dependabot/maven/org.junit.jupiter-junit-jupiter-5.7.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[commons-vfs] branch master updated: Simplify some equals statement by use Objects.equals

2020-11-07 Thread jochen
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-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new 3b37042  Simplify some equals statement by use Objects.equals
 new cf1e5c6  Merge pull request #146 from PeterAlfredLee/simplify-equals
3b37042 is described below

commit 3b370429d821232e9c180f0baf6c5e3e90d34eb3
Author: PeterAlfredLee 
AuthorDate: Sat Nov 7 15:24:11 2020 +0800

Simplify some equals statement by use Objects.equals
---
 .../java/org/apache/commons/vfs2/UserAuthenticationData.java  | 11 ++-
 .../vfs2/provider/sftp/SftpFileSystemConfigBuilder.java   | 10 ++
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
index 1d37a0e..fe07ffa 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
@@ -16,8 +16,8 @@
  */
 package org.apache.commons.vfs2;
 
-import java.util.Iterator;
 import java.util.Map;
+import java.util.Objects;
 import java.util.TreeMap;
 
 /**
@@ -49,14 +49,7 @@ public class UserAuthenticationData {
 if (o == null || getClass() != o.getClass()) {
 return false;
 }
-
-final Type type1 = (Type) o;
-
-if (type != null ? !type.equals(type1.type) : type1.type != null) {
-return false;
-}
-
-return true;
+return Objects.equals(type, ((Type) o).type);
 }
 
 @Override
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
index a55082e..afdde3f 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
@@ -19,6 +19,7 @@ package org.apache.commons.vfs2.provider.sftp;
 import java.io.File;
 import java.io.Serializable;
 import java.util.Arrays;
+import java.util.Objects;
 
 import org.apache.commons.vfs2.FileSystem;
 import org.apache.commons.vfs2.FileSystemConfigBuilder;
@@ -61,14 +62,7 @@ public final class SftpFileSystemConfigBuilder extends 
FileSystemConfigBuilder {
 if (obj == null || this.getClass() != obj.getClass()) {
 return false;
 }
-
-final ProxyType pType = (ProxyType) obj;
-
-if (this.proxyType != null ? 
!this.proxyType.equals(pType.proxyType) : pType.proxyType != null) {
-return false;
-}
-
-return true;
+return Objects.equals(this.proxyType, ((ProxyType) obj).proxyType);
 }
 
 /**



[commons-fileupload] 01/01: Merge pull request #35 from apache/dependabot/maven/org.apache.maven.plugins-maven-pmd-plugin-3.13.0

2020-11-05 Thread jochen
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

commit 53c8d88c1173ec40df46d287e6623b9c95ccfedf
Merge: 3e66bc7 366a30c
Author: Jochen Wiedmann 
AuthorDate: Thu Nov 5 23:40:07 2020 +0100

Merge pull request #35 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-pmd-plugin-3.13.0

Bump maven-pmd-plugin from 3.12.0 to 3.13.0

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)




[commons-fileupload] 01/01: Merge pull request #35 from apache/dependabot/maven/org.apache.maven.plugins-maven-pmd-plugin-3.13.0

2020-11-05 Thread jochen
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

commit 53c8d88c1173ec40df46d287e6623b9c95ccfedf
Merge: 3e66bc7 366a30c
Author: Jochen Wiedmann 
AuthorDate: Thu Nov 5 23:40:07 2020 +0100

Merge pull request #35 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-pmd-plugin-3.13.0

Bump maven-pmd-plugin from 3.12.0 to 3.13.0

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)




  1   2   3   4   >