[jira] [Commented] (IO-822) I hope to add a file size tool class for converting units such as TB, GB, MB, etc, such as java.util.concurrent.TimeUnit.java

2023-11-22 Thread hellozrh (Jira)


[ 
https://issues.apache.org/jira/browse/IO-822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788966#comment-17788966
 ] 

hellozrh commented on IO-822:
-

PR is https://github.com/apache/commons-io/pull/515

> I hope to add a file size tool class for converting units such as TB, GB, MB, 
> etc,  such as java.util.concurrent.TimeUnit.java
> --
>
> Key: IO-822
> URL: https://issues.apache.org/jira/browse/IO-822
> Project: Commons IO
>  Issue Type: Wish
>  Components: Utilities
> Environment: java8+
>Reporter: hellozrh
>Priority: Minor
>  Labels: features
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> a tool for file size converting,  TB, GB, MB, KB convert to each other, 
> including Byte conversion to a size that is convenient for human reading。



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[PR] add a file size conversion tool. [commons-io]

2023-11-22 Thread via GitHub


hellozrh opened a new pull request, #515:
URL: https://github.com/apache/commons-io/pull/515

   File size conversion tool, supporting mutual conversion of TB, GB, MB, KB, 
Byte, etc.,as well as converting the size of numeric types into human-readable 
strings. #https://issues.apache.org/jira/browse/IO-822 
   
The tool can convert any size unit into a human readable version, and 
support file size unit conversion to and from each other. The implementation 
method refers to TimeUnit, adopts the feature of enumeration, simplifies the 
code, and has high efficiency.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] COLLECTIONS-850- Fix Flaky test testMultiValuedMapIterator [commons-collections]

2023-11-22 Thread via GitHub


anirudh711 opened a new pull request, #429:
URL: https://github.com/apache/commons-collections/pull/429

   ## PR Overview
   
   This PR propses a fix for the following tests: 
   - 
`org.apache.commons.collections4.multimap.ArrayListValuedHashMapTest.testMultiValuedMapIterator`
   
   - 
`org.apache.commons.collections4.multimap.TransformedMultiValuedMapTest.testMultiValuedMapIterator`
   
   JIRA Issue Link: https://issues.apache.org/jira/browse/COLLECTIONS-850
   
   ## Test Overview
   The test `testMultiValuedMapIterator` tests how the iteration of a 
multi-value map works. A MultiValuedMap is basically a map with a key value 
that can associate itself with either a single value or multiple values 
(Collections).  Here the MultiValueMap has a key that associates to an array of 
values.
   
   You can reproduce the issue by running the following commands -
   ```
   mvn install -pl . -am -DskipTests
   mvn  
-Dtest=org.apache.commons.collections4.multimap.ArrayListValuedHashMapTest#testMultiValuedMapIterator
   mvn  edu.illinois:nondex-maven-plugin:2.1.1:nondex 
-Dtest=org.apache.commons.collections4.multimap.ArrayListValuedHashMapTest#testMultiValuedMapIterator
   ```
   
   ## Problem
   In this test, a multivalued map is defined and an iterator is defined on top 
of that. The test is flaky since the order inside the multivalued map is not 
maintained. 
   Since the order is not maintained, the iterator can have any one key of the 
three keys for this test ( one, two, three) in random fashion. This flakiness 
was identified by the [nondex 
tool](https://github.com/TestingResearchIllinois/NonDex) created by the 
researchers of UIUC.
   The following code snippet fails because of the above reason
   
https://github.com/apache/commons-collections/blob/35e408717379eed0085cdb29e879209dbadc1ead/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java#L837-L857
   
   ## Fix 
   To maintain order, we can implement a TreeMap or a LinkedHashMap but that 
will change the base code and affect all other entities related to this.
   This PR proposes a fix inside the test while keeping the test logic intact.  
Since the order is not maintained, we check for the iterator's next value to 
either be one of the keys and if it is, we check the original assert 
statements. We follow the same approach to assert all the cases.
   
   
https://github.com/apache/commons-collections/blob/02f85e2c9f6cba3a9c76ab30e51bd9d64070977d/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java#L837-L860
   
   This PR provides a fix on the abstract class which fixes the classes that 
implement it, hence fixing the tests with classes implementing the abstract 
class


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Updated] (COLLECTIONS-850) testMultiValuedMapIterator is non-deterministic

2023-11-22 Thread Anirudh Ragavender (Jira)


 [ 
https://issues.apache.org/jira/browse/COLLECTIONS-850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anirudh Ragavender updated COLLECTIONS-850:
---
Description: 
Overview of PR 
This PR proposes a fix for the following tests:
 * 
org.apache.commons.collections4.multimap.TransformedMultiValuedMapTest.testMultiValuedMapIterator
 * 
org.apache.commons.collections4.multimap.ArrayListValuedHashMapTest.testMultiValuedMapIterator

Problem:
In this test, a multivalued map is defined and an iterator is defined on top of 
that. The test is flaky since the order inside the multivalued map is not 
maintained.
Since the order is not maintained, the iterator can have any one key of the 
three keys for this test ( one, two, three) in random fashion. This flakiness 
was identified by the [nondex 
tool|https://github.com/TestingResearchIllinois/NonDex] created by the 
researchers of UIUC.

Fix:

To maintain order, we can implement a TreeMap or a LinkedHashMap but that will 
change the base code and affect all other entities related to this.
This PR proposes a fix inside the test while keeping the test logic intact. 
Since the order is not maintained, we check for the iterator's next value to 
either be one of the keys and if it is, we check the original assert 
statements. We follow the same approach to assert all the cases.

  was:
Overview of PR 
This PR proposes a fix for the following tests:
 * 
org.apache.commons.collections4.multimap.TransformedMultiValuedMapTest.testMultiValuedMapIterator
 * 
org.apache.commons.collections4.multimap.ArrayListValuedHashMapTest.testMultiValuedMapIterator

Problem:
In this test, a multivalued map is defined and an iterator is defined on top of 
that. The test is flaky since the order inside the multivalued map is not 
maintained.
Since the order is not maintained, the iterator can have any one key of the 
three keys for this test ( one, two, three) in random fashion. This flakiness 
was identified by the [nondex 
tool|https://github.com/TestingResearchIllinois/NonDex] created by the 
researchers of UIUC.

Fix:

To maintain order, we can implement a TreeMap or a LinkedHashMap but that will 
change the base code and affect all other entities related to this.
This PR proposes a fix inside the test while keeping the test logic intact. 
Since the order is not maintained, we check for the iterator's next value to 
either be one of the keys and if it is, we check the original assert 
statements. We follow the same approach to assert all the cases.
 
{{{}{}}}{{{}{}}}{{{}{}}}{{{}{}}}


> testMultiValuedMapIterator is non-deterministic
> ---
>
> Key: COLLECTIONS-850
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-850
> Project: Commons Collections
>  Issue Type: Bug
>  Components: Map
>Affects Versions: 4.4
>Reporter: Anirudh Ragavender
>Priority: Minor
> Fix For: 4.5
>
>
> Overview of PR 
> This PR proposes a fix for the following tests:
>  * 
> org.apache.commons.collections4.multimap.TransformedMultiValuedMapTest.testMultiValuedMapIterator
>  * 
> org.apache.commons.collections4.multimap.ArrayListValuedHashMapTest.testMultiValuedMapIterator
> Problem:
> In this test, a multivalued map is defined and an iterator is defined on top 
> of that. The test is flaky since the order inside the multivalued map is not 
> maintained.
> Since the order is not maintained, the iterator can have any one key of the 
> three keys for this test ( one, two, three) in random fashion. This flakiness 
> was identified by the [nondex 
> tool|https://github.com/TestingResearchIllinois/NonDex] created by the 
> researchers of UIUC.
> Fix:
> To maintain order, we can implement a TreeMap or a LinkedHashMap but that 
> will change the base code and affect all other entities related to this.
> This PR proposes a fix inside the test while keeping the test logic intact. 
> Since the order is not maintained, we check for the iterator's next value to 
> either be one of the keys and if it is, we check the original assert 
> statements. We follow the same approach to assert all the cases.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (COLLECTIONS-850) testMultiValuedMapIterator is non-deterministic

2023-11-22 Thread Anirudh Ragavender (Jira)
Anirudh Ragavender created COLLECTIONS-850:
--

 Summary: testMultiValuedMapIterator is non-deterministic
 Key: COLLECTIONS-850
 URL: https://issues.apache.org/jira/browse/COLLECTIONS-850
 Project: Commons Collections
  Issue Type: Bug
  Components: Map
Affects Versions: 4.4
Reporter: Anirudh Ragavender
 Fix For: 4.5


Overview of PR 
This PR proposes a fix for the following tests:
 * 
org.apache.commons.collections4.multimap.TransformedMultiValuedMapTest.testMultiValuedMapIterator
 * 
org.apache.commons.collections4.multimap.ArrayListValuedHashMapTest.testMultiValuedMapIterator

Problem:
In this test, a multivalued map is defined and an iterator is defined on top of 
that. The test is flaky since the order inside the multivalued map is not 
maintained.
Since the order is not maintained, the iterator can have any one key of the 
three keys for this test ( one, two, three) in random fashion. This flakiness 
was identified by the [nondex 
tool|https://github.com/TestingResearchIllinois/NonDex] created by the 
researchers of UIUC.

Fix:

To maintain order, we can implement a TreeMap or a LinkedHashMap but that will 
change the base code and affect all other entities related to this.
This PR proposes a fix inside the test while keeping the test logic intact. 
Since the order is not maintained, we check for the iterator's next value to 
either be one of the keys and if it is, we check the original assert 
statements. We follow the same approach to assert all the cases.
 
{{{}{}}}{{{}{}}}{{{}{}}}{{{}{}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (JEXL-416) Null-valued pragma throws NPE in 3.3

2023-11-22 Thread William Price (Jira)
William Price created JEXL-416:
--

 Summary: Null-valued pragma throws NPE in 3.3
 Key: JEXL-416
 URL: https://issues.apache.org/jira/browse/JEXL-416
 Project: Commons JEXL
  Issue Type: Bug
Affects Versions: 3.3
 Environment: JEXL 3.3
Java 21 (21+35) Red Hat, Inc.
Linux 5.15.133.1-microsoft-standard-WSL2 (amd64)
Reporter: William Price


Version 3.2.1 seemed to allow {{null}} as a value for pragmas, but version 3.3 
throws NPE.  I'm not necessarily advocating for null pragma values, but it's a 
behavior regression due to the use of {{{}TreeMap::merge{}}}. Even if 
disallowing nulls was desired, it should be a JexlException not NPE.

Passes on 3.2.1:
{code:java}
var script = engine.createScript("#pragma myNull null\n");
var pragmas = script.getPragmas();
assertTrue(pragmas.containsKey("myNull"), "pragma key present?");
assertNull(pragmas.get("myNull"), "expected null value"); {code}
Behavior on 3.3:
{code:java}
assertThrows(
NullPointerException.class,
() -> engine.createScript("#pragma myNull null\n"));
{code}
{noformat}
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at java.base/java.util.TreeMap.merge(TreeMap.java:743)
at 
org.apache.commons.jexl3.parser.JexlParser.declarePragma(JexlParser.java:557)
at org.apache.commons.jexl3.parser.Parser.Pragma(Parser.java:1246)
at org.apache.commons.jexl3.parser.Parser.JexlScript(Parser.java:63)
at org.apache.commons.jexl3.parser.Parser.parse(Parser.java:25)
at org.apache.commons.jexl3.internal.Engine.parse(Engine.java:1009)
at 
org.apache.commons.jexl3.internal.Engine.createScript(Engine.java:617)
at org.apache.commons.jexl3.internal.Engine.createScript(Engine.java:69)
at org.apache.commons.jexl3.JexlEngine.createScript(JexlEngine.java:375)
{noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[PR] COLLECTIONS-804- Fix flaky test testCollectionToArray2 [commons-collections]

2023-11-22 Thread via GitHub


anirudh711 opened a new pull request, #428:
URL: https://github.com/apache/commons-collections/pull/428

   ## **Problem:**
   The test testCollectionToArray2 is flaky because the array in use does not 
maintain the order of the elements. This was caught by the 
[nondex](https://github.com/TestingResearchIllinois/NonDex) tool created by the 
researchers of UIUC.
   Related issue : https://issues.apache.org/jira/browse/COLLECTIONS-804
   Related PR with a similar fix: 
https://github.com/apache/commons-collections/pull/341
   ## **Description:**
   The flakiness occurs in two places
   
   
https://github.com/apache/commons-collections/blob/35e408717379eed0085cdb29e879209dbadc1ead/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java#L1132-L1136
   
   
https://github.com/apache/commons-collections/blob/35e408717379eed0085cdb29e879209dbadc1ead/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java#L1156-L1162
   
   
   The function `getIterationBehaviour()` returns 0 by default mentioning the 
array is ordered and the constant `UNORDERED` is used for the functions that 
might be unordered in which a different assertion `assertUnorderedArrayEquals` 
will be used .
   Since the code is part of the abstract class, this code has to remain 
untouched but the `getIterationBehaviour()`  of the classes implementing this 
abstract class can be changed.
   
   `getIterationBehaviour()` of the class `TestMapEntrySet` returns 0 which 
means it assumes the array being ordered for `TestMapEntrySet` which is not 
true. The order of elements can be changed and will be nondeterministic.
   
   ## **Fix:**
   In the overriding function, the return value has to be changed from 0 to 1 
which mentions it can be unordered and this will only affect the 
`TestMapEntrySet` and not other classes.
   
   
https://github.com/anirudh711/commons-collections/blob/90a80f010822fca17323bfc043f14ebc71c92a78/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java#L1644-L1648
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] COMPRESS-632: Fixes for dump file parsing [commons-compress]

2023-11-22 Thread via GitHub


yakovsh commented on code in PR #442:
URL: https://github.com/apache/commons-compress/pull/442#discussion_r1402701318


##
src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java:
##
@@ -294,6 +294,9 @@ public void resetBlockSize(final int recsPerBlock, final 
boolean isCompressed) t
 throw new IOException("Block with " + recsPerBlock + " records 
found, must be at least 1");
 }
 blockSize = RECORD_SIZE * recsPerBlock;
+if (blockSize < 1) {
+throw new IOException("Block size " + blockSize + " cannot be 
negative");

Review Comment:
   I will fix this, zeros should be invalid as well



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] COMPRESS-632: Fixes for CPIO bugs [commons-compress]

2023-11-22 Thread via GitHub


yakovsh commented on code in PR #441:
URL: https://github.com/apache/commons-compress/pull/441#discussion_r1402688746


##
src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java:
##
@@ -362,7 +362,11 @@ public int read(final byte[] b, final int off, final int 
len) throws IOException
 
 private long readAsciiLong(final int length, final int radix) throws 
IOException {
 final byte[] tmpBuffer = readRange(length);
-return Long.parseLong(ArchiveUtils.toAsciiString(tmpBuffer), radix);
+try {

Review Comment:
   Should this be moved to a utility class like with ExactMath and wrapped with 
an IOException in that class? So maybe something like this:
   ```
   public static long parseLong(final String value) throws IOException {
   try {
   return Long.parseLong(value);
   } catch (final NumberFormatException exp) {
   throw new IOException("Unable to parse long from string value: " 
+ value);
   }
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] COMPRESS-632: Fixes for CPIO bugs [commons-compress]

2023-11-22 Thread via GitHub


yakovsh commented on code in PR #441:
URL: https://github.com/apache/commons-compress/pull/441#discussion_r1402677972


##
src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntryTest.java:
##
@@ -0,0 +1,32 @@
+/*
+ * 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.compress.archivers.cpio;
+
+import static org.junit.Assert.assertThrows;
+
+import org.junit.jupiter.api.Test;
+
+public class CpioArchiveEntryTest {
+@Test
+public void testGetHeaderPadCountOverflow() throws Exception {
+CpioArchiveEntry entry = new 
CpioArchiveEntry(CpioConstants.FORMAT_NEW);

Review Comment:
   Thanks, I will address this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException [commons-codec]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #222:
URL: https://github.com/apache/commons-codec/pull/222#discussion_r1402656990


##
src/test/java/org/apache/commons/codec/net/PercentCodecTest.java:
##
@@ -105,6 +106,13 @@ public void testEncodeUnsupportedObject() {
 assertThrows(EncoderException.class, () -> 
percentCodec.encode("test"));
 }
 
+@Test
+public void testInvalidByte() {
+byte[] invalid = {(byte)-1};

Review Comment:
   Use `final` where you can.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Updated] (COMPRESS-654) Issue extracting certain sparse tarballs

2023-11-22 Thread Xudong Yang (Jira)


 [ 
https://issues.apache.org/jira/browse/COMPRESS-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xudong Yang updated COMPRESS-654:
-
Description: 
We maintain the Bazel ([https://bazel.build/]) build system, which uses Apache 
Commons Compress to handle archive extraction. A user reported that a certain 
sparse tarball always triggers an error 
([https://github.com/bazelbuild/bazel/issues/20269#issuecomment-1821250607]), 
and the steps to reproduce the error are very simple:
 

{{#!/usr/bin/env bash}}

{{set -o errexit -o nounset}}

{{echo "Downloading commons-compress"}}
{{wget 
[https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.25.0/commons-compress-1.25.0.jar]echo
 "Downloading sample sparse archive"}}
{{wget 
[https://github.com/astral-sh/ruff/releases/download/v0.1.6/ruff-aarch64-apple-darwin.tar.gz]gunzip
 ruff-aarch64-apple-darwin.tar.gz}}

{{echo "Testing with system tar"}}
{{tar -tf ruff-aarch64-apple-darwin.tar}}
{{echo "Testing with commons-compress"}}
{{java -jar commons-compress-1.25.0.jar ruff-aarch64-apple-darwin.tar}}
 



Output:

 

{{Testing with system tar}}
{{ruff}}
{{Testing with commons-compress}}
{{Analysing ruff-aarch64-apple-darwin.tar}}
{{Created 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream@17f052a3}}
{{ruff}}
{{Exception in thread "main" java.io.IOException: Truncated TAR archive}}
{{at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:694)}}
{{at org.apache.commons.compress.utils.IOUtils.readFully(IOUtils.java:244)}}
{{at org.apache.commons.compress.utils.IOUtils.skip(IOUtils.java:355)}}
{{at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:451)}}
{{at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:426)}}
{{at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:50)}}
{{at org.apache.commons.compress.archivers.Lister.listStream(Lister.java:79)}}
{{at org.apache.commons.compress.archivers.Lister.main(Lister.java:133)}}

  was:
We maintain the Bazel ([https://bazel.build/]) build system, which uses Apache 
Commons Compress to handle archive extraction. A user reported that a certain 
sparse tarball always triggers an error 
([https://github.com/bazelbuild/bazel/issues/20269#issuecomment-1821250607]), 
and the steps to reproduce the error are very simple:
 

{{#!/usr/bin/env bash

set -o errexit -o nounset

echo "Downloading commons-compress"
wget 
[https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.25.0/commons-compress-1.25.0.jar]echo
 "Downloading sample sparse archive"
wget 
[https://github.com/astral-sh/ruff/releases/download/v0.1.6/ruff-aarch64-apple-darwin.tar.gz]gunzip
 ruff-aarch64-apple-darwin.tar.gz

echo "Testing with system tar"
tar -tf ruff-aarch64-apple-darwin.tar
echo "Testing with commons-compress"
java -jar commons-compress-1.25.0.jar ruff-aarch64-apple-darwin.tar}}
 
->

{{Testing with system tar
ruff
Testing with commons-compress
Analysing ruff-aarch64-apple-darwin.tar
Created org.apache.commons.compress.archivers.tar.TarArchiveInputStream@17f052a3
ruff
Exception in thread "main" java.io.IOException: Truncated TAR archive
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:694)
at org.apache.commons.compress.utils.IOUtils.readFully(IOUtils.java:244)
at org.apache.commons.compress.utils.IOUtils.skip(IOUtils.java:355)
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:451)
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:426)
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:50)
at 
org.apache.commons.compress.archivers.Lister.listStream(Lister.java:79)
at org.apache.commons.compress.archivers.Lister.main(Lister.java:133)}}


> Issue extracting certain sparse tarballs
> 
>
> Key: COMPRESS-654
> URL: https://issues.apache.org/jira/browse/COMPRESS-654
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.25.0
>Reporter: Xudong Yang
>Priority: Major
>
> We maintain the Bazel ([https://bazel.build/]) build system, which uses 
> Apache Commons Compress to handle archive extraction. A user reported that a 
> certain sparse tarball always triggers an error 
> ([https://github.com/bazelbuild/bazel/issues/20269#issuecomment-1821250607]), 
> and the steps to reproduce the error are very simple:
>  
> {{#!/usr/bin/env bash}}
> {{set -o errexit -o nounset}}
> {{echo "Downloading 

Re: [PR] COMPRESS-632: Fixes for CPIO bugs [commons-compress]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #441:
URL: https://github.com/apache/commons-compress/pull/441#discussion_r1402656352


##
src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java:
##
@@ -362,7 +362,11 @@ public int read(final byte[] b, final int off, final int 
len) throws IOException
 
 private long readAsciiLong(final int length, final int radix) throws 
IOException {
 final byte[] tmpBuffer = readRange(length);
-return Long.parseLong(ArchiveUtils.toAsciiString(tmpBuffer), radix);
+try {

Review Comment:
   Hi @yakovsh 
   It turns out, we do this kind of Long parse-and-rethrow-IOException in at 
least three other places. I'd think this should be refactored. Also, in total, 
there are ten call sites for Long parsing. Shouldn't all these be addressed 
uniformly in this PR? There are also Integer.parseXXX() calls that likely need 
the same treatment. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (COMPRESS-654) Issue extracting certain sparse tarballs

2023-11-22 Thread Xudong Yang (Jira)
Xudong Yang created COMPRESS-654:


 Summary: Issue extracting certain sparse tarballs
 Key: COMPRESS-654
 URL: https://issues.apache.org/jira/browse/COMPRESS-654
 Project: Commons Compress
  Issue Type: Bug
  Components: Archivers
Affects Versions: 1.25.0
Reporter: Xudong Yang


We maintain the Bazel ([https://bazel.build/]) build system, which uses Apache 
Commons Compress to handle archive extraction. A user reported that a certain 
sparse tarball always triggers an error 
([https://github.com/bazelbuild/bazel/issues/20269#issuecomment-1821250607]), 
and the steps to reproduce the error are very simple:
 

{{#!/usr/bin/env bash

set -o errexit -o nounset

echo "Downloading commons-compress"
wget 
[https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.25.0/commons-compress-1.25.0.jar]echo
 "Downloading sample sparse archive"
wget 
[https://github.com/astral-sh/ruff/releases/download/v0.1.6/ruff-aarch64-apple-darwin.tar.gz]gunzip
 ruff-aarch64-apple-darwin.tar.gz

echo "Testing with system tar"
tar -tf ruff-aarch64-apple-darwin.tar
echo "Testing with commons-compress"
java -jar commons-compress-1.25.0.jar ruff-aarch64-apple-darwin.tar}}
 
->

{{Testing with system tar
ruff
Testing with commons-compress
Analysing ruff-aarch64-apple-darwin.tar
Created org.apache.commons.compress.archivers.tar.TarArchiveInputStream@17f052a3
ruff
Exception in thread "main" java.io.IOException: Truncated TAR archive
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:694)
at org.apache.commons.compress.utils.IOUtils.readFully(IOUtils.java:244)
at org.apache.commons.compress.utils.IOUtils.skip(IOUtils.java:355)
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:451)
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:426)
at 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:50)
at 
org.apache.commons.compress.archivers.Lister.listStream(Lister.java:79)
at org.apache.commons.compress.archivers.Lister.main(Lister.java:133)}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] COMPRESS-632: Fixes for CPIO bugs [commons-compress]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #441:
URL: https://github.com/apache/commons-compress/pull/441#discussion_r1402652002


##
src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntryTest.java:
##
@@ -0,0 +1,32 @@
+/*
+ * 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.compress.archivers.cpio;
+
+import static org.junit.Assert.assertThrows;
+
+import org.junit.jupiter.api.Test;
+
+public class CpioArchiveEntryTest {
+@Test
+public void testGetHeaderPadCountOverflow() throws Exception {
+CpioArchiveEntry entry = new 
CpioArchiveEntry(CpioConstants.FORMAT_NEW);

Review Comment:
   Use final where you can.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] COMPRESS-632: Fixes for dump file parsing [commons-compress]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #442:
URL: https://github.com/apache/commons-compress/pull/442#discussion_r1402651501


##
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java:
##
@@ -26,7 +26,7 @@ public final class DumpArchiveConstants {
  * The type of compression.
  */
 public enum COMPRESSION_TYPE {
-ZLIB(0), BZLIB(1), LZO(2);
+UNKNOWN(-1), ZLIB(0), BZLIB(1), LZO(2);

Review Comment:
   Is this required? Does it avoid an NPE? I do not see it used outside of this 
enum,



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] COMPRESS-632: Fixes for dump file parsing [commons-compress]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #442:
URL: https://github.com/apache/commons-compress/pull/442#discussion_r1402647680


##
src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java:
##
@@ -294,6 +294,9 @@ public void resetBlockSize(final int recsPerBlock, final 
boolean isCompressed) t
 throw new IOException("Block with " + recsPerBlock + " records 
found, must be at least 1");
 }
 blockSize = RECORD_SIZE * recsPerBlock;
+if (blockSize < 1) {
+throw new IOException("Block size " + blockSize + " cannot be 
negative");

Review Comment:
   Either the test or the error message is incorrect. If the test is correct 
then the error message should say `"Block size cannot be less than or equal to 
0: " + blockSize"`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump com.github.marschall:memoryfilesystem from 2.6.1 to 2.7.0 [commons-compress]

2023-11-22 Thread via GitHub


garydgregory merged PR #444:
URL: https://github.com/apache/commons-compress/pull/444


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan commented on PR #222:
URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1823363053

   Hi, I have added unit test. I am not sure about combining the PRs since they 
are opened as 4 different issues in the JIRA. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-313: Fix possible ArrayIndexOutOfBoundsException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan commented on PR #221:
URL: https://github.com/apache/commons-codec/pull/221#issuecomment-1823364457

   Hi, I have added the unit test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-312: Fix possible StringIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan commented on PR #220:
URL: https://github.com/apache/commons-codec/pull/220#issuecomment-1823363932

   Hi, I have added the unit test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-311: Fix possible ArrayIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan commented on code in PR #219:
URL: https://github.com/apache/commons-codec/pull/219#discussion_r1402525412


##
src/test/java/org/apache/commons/codec/language/RefinedSoundexTest.java:
##
@@ -93,4 +94,13 @@ public void testNewInstance2() {
 public void testNewInstance3() {
 assertEquals("D6043", new 
RefinedSoundex(RefinedSoundex.US_ENGLISH_MAPPING_STRING).soundex("dogs"));
 }
+
+@Test
+public void testInvalidSoundexCharacter() {
+char[] invalid = new char[256];
+for (int i = 0; i < 256; i++) {

Review Comment:
   Have changed. Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-311: Fix possible ArrayIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #219:
URL: https://github.com/apache/commons-codec/pull/219#discussion_r1402516762


##
src/test/java/org/apache/commons/codec/language/RefinedSoundexTest.java:
##
@@ -93,4 +94,13 @@ public void testNewInstance2() {
 public void testNewInstance3() {
 assertEquals("D6043", new 
RefinedSoundex(RefinedSoundex.US_ENGLISH_MAPPING_STRING).soundex("dogs"));
 }
+
+@Test
+public void testInvalidSoundexCharacter() {
+char[] invalid = new char[256];
+for (int i = 0; i < 256; i++) {

Review Comment:
   Hello @arthurscchan 
   You'll want to remove use of the magic number here and say `invalid.length`.
   TY!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-311: Fix possible ArrayIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan commented on PR #219:
URL: https://github.com/apache/commons-codec/pull/219#issuecomment-1823262547

   @garydgregory Thanks for the comment. I have added a unit test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1823246922

   Hi @garydgregory, could you please review the Pull request whenever you have 
time? Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1823216947

   > AbstractTestColumnHandler
   
   Hi @garydgregory, I have made changes to the mentioned files. However, the 
empty if block cannot be fixed since we intend to not do anything for the 
condition.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1823182229

   > One PR please, this one.
   
   Sure. Will do. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException [commons-codec]

2023-11-22 Thread via GitHub


garydgregory commented on PR #222:
URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1823156553

   Let's just have ONE PR instead of one-liner PRs. Especially since these all 
claim to fix the exact same kind of issue. Also, you MUST provide a matching 
test.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-313: Fix possible ArrayIndexOutOfBoundsException [commons-codec]

2023-11-22 Thread via GitHub


garydgregory commented on PR #221:
URL: https://github.com/apache/commons-codec/pull/221#issuecomment-1823153671

   @arthurscchan 
   You'll need a unit test to prove what the main change does.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CODEC-312: Fix possible StringIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


garydgregory commented on PR #220:
URL: https://github.com/apache/commons-codec/pull/220#issuecomment-1823151696

   Hello @arthurscchan 
   Same comment: You'll need a unit test to prove what the main code does.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] (CODEC-312) MatchRatingApproachEncoder.encode throw StringIndexOutOfBound

2023-11-22 Thread Sheung Chi Chan (Jira)


[ https://issues.apache.org/jira/browse/CODEC-312 ]


Sheung Chi Chan deleted comment on CODEC-312:
---

was (Author: JIRAUSER303223):
Suggested fixing PR: https://github.com/apache/commons-codec/pull/220

> MatchRatingApproachEncoder.encode throw StringIndexOutOfBound
> -
>
> Key: CODEC-312
> URL: https://issues.apache.org/jira/browse/CODEC-312
> Project: Commons Codec
>  Issue Type: Bug
>Reporter: Sheung Chi Chan
>Priority: Minor
>  Labels: StringIndexOutOfBound
>
> The {{encode(String)}} method takes in a random String and checks if it is 
> empty. It will go through a few rounds of processing if the given String is 
> not empty. It does contain a check to ensure the String is not empty before 
> processing. But it has some missing checks. Each of the 3 processing methods 
> {{cleanName(name)}} / {{removeVowels(name)}} / 
> {{removeDoubleConsonants(name)}} remove some characters from the String and 
> could cause the string to become empty (length = 0). And that results in 
> StringIndexOutOfBoundException when {{substring()}} method is called in the 
> next processing method. For example, if the randomly provided string is 
> {{{}..{}}}, it gets past the first checking in the encode method and enters 
> the {{cleanName(name)}} method. The {{cleanName(name)}} method removes the 
> two dots and returns an empty string. Without the additional checking, it 
> causes the StringIndexOutOfBoundException in the {{substring()}} method call 
> in the next {{removeVowels(name)}} method call cause the length of the string 
> is 0.
> Possible fix could add some conditional checking to ensure the string is not 
> empty after each method call. If it is empty after any method call, it will 
> simply return {{EMPTY}} and avoid continuing processing onto the next 
> processing method.
> We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
> [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64359].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] (CODEC-313) QuotedPrintableCodec.encodeQuotedPrintable throws ArrayIndexOutOfBoundException

2023-11-22 Thread Sheung Chi Chan (Jira)


[ https://issues.apache.org/jira/browse/CODEC-313 ]


Sheung Chi Chan deleted comment on CODEC-313:
---

was (Author: JIRAUSER303223):
Suggested fix PR: https://github.com/apache/commons-codec/pull/221

> QuotedPrintableCodec.encodeQuotedPrintable throws 
> ArrayIndexOutOfBoundException
> ---
>
> Key: CODEC-313
> URL: https://issues.apache.org/jira/browse/CODEC-313
> Project: Commons Codec
>  Issue Type: Bug
>Reporter: Sheung Chi Chan
>Priority: Minor
>  Labels: ArrayIndexOutOfBoundsException
>
> The {{encodeQuotedPrintable()}} method takes in a random byte array and 
> processes it. If the provided {{strict}} boolean is true, it will go into the 
> first branch. There is a for loop to loop through the byte array from the 
> index 0 to the index byte.length - 3. The index is then used directly in 
> {{getUnsignedOctet}} method If the length of the byte array is less than 3, 
> it will result in a negative index and cause ArrayIndexOutOfBoundsException 
> in {{getUnsignedOctet()}} method call.
> Possible fix could add a conditional check to ensure the index is never 
> negative. It will simply return null if the byte array is too short (with a 
> length less than 3) if {{strict}} value is true.
> We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
> [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64358].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] CODEC-311: Fix possible ArrayIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


garydgregory commented on PR #219:
URL: https://github.com/apache/commons-codec/pull/219#issuecomment-1823149555

   Hello @arthurscchan 
   You'll need a unit test to prove this change works.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Commented] (CODEC-313) QuotedPrintableCodec.encodeQuotedPrintable throws ArrayIndexOutOfBoundException

2023-11-22 Thread Sheung Chi Chan (Jira)


[ 
https://issues.apache.org/jira/browse/CODEC-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788834#comment-17788834
 ] 

Sheung Chi Chan commented on CODEC-313:
---

Suggested fix PR: https://github.com/apache/commons-codec/pull/221

> QuotedPrintableCodec.encodeQuotedPrintable throws 
> ArrayIndexOutOfBoundException
> ---
>
> Key: CODEC-313
> URL: https://issues.apache.org/jira/browse/CODEC-313
> Project: Commons Codec
>  Issue Type: Bug
>Reporter: Sheung Chi Chan
>Priority: Minor
>  Labels: ArrayIndexOutOfBoundsException
>
> The {{encodeQuotedPrintable()}} method takes in a random byte array and 
> processes it. If the provided {{strict}} boolean is true, it will go into the 
> first branch. There is a for loop to loop through the byte array from the 
> index 0 to the index byte.length - 3. The index is then used directly in 
> {{getUnsignedOctet}} method If the length of the byte array is less than 3, 
> it will result in a negative index and cause ArrayIndexOutOfBoundsException 
> in {{getUnsignedOctet()}} method call.
> Possible fix could add a conditional check to ensure the index is never 
> negative. It will simply return null if the byte array is too short (with a 
> length less than 3) if {{strict}} value is true.
> We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
> [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64358].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] (CODEC-311) RefinedSoundex.getMappingCode throw ArrayIndexOutOfBoundException

2023-11-22 Thread Sheung Chi Chan (Jira)


[ https://issues.apache.org/jira/browse/CODEC-311 ]


Sheung Chi Chan deleted comment on CODEC-311:
---

was (Author: JIRAUSER303223):
Suggested fixing PR: https://github.com/apache/commons-codec/pull/219

> RefinedSoundex.getMappingCode throw ArrayIndexOutOfBoundException
> -
>
> Key: CODEC-311
> URL: https://issues.apache.org/jira/browse/CODEC-311
> Project: Commons Codec
>  Issue Type: Bug
>Reporter: Sheung Chi Chan
>Priority: Minor
>  Labels: arrayindexoutofbounds
>
> The {{getMappingCode(char)}} method takes in a random character retrieved 
> from a string (through processing of {{encode(String)}} or 
> {{soundex(String)}} method) and checks if it is a letter, then returns a 
> mapping code from the {{soundexMapping}} array if it is a letter. But the 
> checking contains a bug. The {{Character.isLetter()}} method will return true 
> not only for English characters. For example, a char with character code 1689 
> will also make {{Character.isLetter()}} returns true. Using a character with 
> large character code that passed the {{Character.isLetter()}} check and a way 
> smaller {{soundexMapping}} array will cause ArrayIndexOutOfBoundException.
> This possible fixes could add a conditional checking to ensure the index is 
> never out of bounds from the configured {{soundexMapping}} array. If the 
> calculated index goes out of bounds, it will simply return 0, just like the 
> original logic when Character.isLetter() returns false.
> We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
> [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64353].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CODEC-312) MatchRatingApproachEncoder.encode throw StringIndexOutOfBound

2023-11-22 Thread Sheung Chi Chan (Jira)


[ 
https://issues.apache.org/jira/browse/CODEC-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788833#comment-17788833
 ] 

Sheung Chi Chan commented on CODEC-312:
---

Suggested fixing PR: https://github.com/apache/commons-codec/pull/220

> MatchRatingApproachEncoder.encode throw StringIndexOutOfBound
> -
>
> Key: CODEC-312
> URL: https://issues.apache.org/jira/browse/CODEC-312
> Project: Commons Codec
>  Issue Type: Bug
>Reporter: Sheung Chi Chan
>Priority: Minor
>  Labels: StringIndexOutOfBound
>
> The {{encode(String)}} method takes in a random String and checks if it is 
> empty. It will go through a few rounds of processing if the given String is 
> not empty. It does contain a check to ensure the String is not empty before 
> processing. But it has some missing checks. Each of the 3 processing methods 
> {{cleanName(name)}} / {{removeVowels(name)}} / 
> {{removeDoubleConsonants(name)}} remove some characters from the String and 
> could cause the string to become empty (length = 0). And that results in 
> StringIndexOutOfBoundException when {{substring()}} method is called in the 
> next processing method. For example, if the randomly provided string is 
> {{{}..{}}}, it gets past the first checking in the encode method and enters 
> the {{cleanName(name)}} method. The {{cleanName(name)}} method removes the 
> two dots and returns an empty string. Without the additional checking, it 
> causes the StringIndexOutOfBoundException in the {{substring()}} method call 
> in the next {{removeVowels(name)}} method call cause the length of the string 
> is 0.
> Possible fix could add some conditional checking to ensure the string is not 
> empty after each method call. If it is empty after any method call, it will 
> simply return {{EMPTY}} and avoid continuing processing onto the next 
> processing method.
> We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
> [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64359].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CODEC-311) RefinedSoundex.getMappingCode throw ArrayIndexOutOfBoundException

2023-11-22 Thread Sheung Chi Chan (Jira)


[ 
https://issues.apache.org/jira/browse/CODEC-311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788832#comment-17788832
 ] 

Sheung Chi Chan commented on CODEC-311:
---

Suggested fixing PR: https://github.com/apache/commons-codec/pull/219

> RefinedSoundex.getMappingCode throw ArrayIndexOutOfBoundException
> -
>
> Key: CODEC-311
> URL: https://issues.apache.org/jira/browse/CODEC-311
> Project: Commons Codec
>  Issue Type: Bug
>Reporter: Sheung Chi Chan
>Priority: Minor
>  Labels: arrayindexoutofbounds
>
> The {{getMappingCode(char)}} method takes in a random character retrieved 
> from a string (through processing of {{encode(String)}} or 
> {{soundex(String)}} method) and checks if it is a letter, then returns a 
> mapping code from the {{soundexMapping}} array if it is a letter. But the 
> checking contains a bug. The {{Character.isLetter()}} method will return true 
> not only for English characters. For example, a char with character code 1689 
> will also make {{Character.isLetter()}} returns true. Using a character with 
> large character code that passed the {{Character.isLetter()}} check and a way 
> smaller {{soundexMapping}} array will cause ArrayIndexOutOfBoundException.
> This possible fixes could add a conditional checking to ensure the index is 
> never out of bounds from the configured {{soundexMapping}} array. If the 
> calculated index goes out of bounds, it will simply return 0, just like the 
> original logic when Character.isLetter() returns false.
> We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
> [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64353].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[PR] CODEC-314: Fix possible IndexOutOfBoundsException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan opened a new pull request, #222:
URL: https://github.com/apache/commons-codec/pull/222

   This fixes a possible IndexOutOfBoundsException in 
[src/main/java/org/apache/commons/codec/net/PercentCodec.java](https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/net/PercentCodec.java)
   
   This PR adds a conditional check to ensure only valid bytes (positive or 
zero) are processed.
   
   We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64362.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] CODEC-312: Fix possible StringIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan opened a new pull request, #220:
URL: https://github.com/apache/commons-codec/pull/220

   This fixes a possible StringIndexOutOfBoundException in 
[src/main/java/org/apache/commons/codec/language/MatchRatingApproachEncoder.java](https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/language/MatchRatingApproachEncoder.java)
   
   This PR adds some conditional checking to ensure the string is not empty 
after each method call. If it is empty after any method call, it will simply 
return EMPTY and avoid continuing processing onto the next processing method.
   
   We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64359.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] CODEC-311: Fix possible ArrayIndexOutOfBoundException [commons-codec]

2023-11-22 Thread via GitHub


arthurscchan opened a new pull request, #219:
URL: https://github.com/apache/commons-codec/pull/219

   This fixes a possible ArrayIndexOutOfBoundException in 
[src/main/java/org/apache/commons/codec/language/RefinedSoundex.java](https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/language/RefinedSoundex.java)
   
   This PR adds a conditional checking to ensure the index is never out of 
bounds from the configured soundexMapping array. If the calculated index goes 
out of bounds, it will simply return 0, just like the original logic when 
Character.isLetter() returns false.
   
   We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64353.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (CODEC-314) PercentCodec.insertAlwaysEncodeChars throws IndexOutOfBoundException

2023-11-22 Thread Sheung Chi Chan (Jira)
Sheung Chi Chan created CODEC-314:
-

 Summary: PercentCodec.insertAlwaysEncodeChars throws 
IndexOutOfBoundException
 Key: CODEC-314
 URL: https://issues.apache.org/jira/browse/CODEC-314
 Project: Commons Codec
  Issue Type: Bug
Reporter: Sheung Chi Chan


The {{insertAlwaysEncodeChars()}} method takes in a random byte array (through 
the constructor of PercentCodec class) and processes it byte by byte. Each byte 
is passed to {{insertAlwaysEncodeChar()}} to set the corresponding bit in the 
BitSet object {{alwaysEncodeChars}} to true by calling the {{set()}} method of 
the BitSet object. As BitSet only accept positive index, if any byte is 
negative, it will cause IndexOutOfBoundsException when calling the {{set()}} 
method.

Possible fix could add a conditional check to ensure only valid bytes (positive 
or zero) are processed.

We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
[https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64362].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CODEC-313) QuotedPrintableCodec.encodeQuotedPrintable throws ArrayIndexOutOfBoundException

2023-11-22 Thread Sheung Chi Chan (Jira)
Sheung Chi Chan created CODEC-313:
-

 Summary: QuotedPrintableCodec.encodeQuotedPrintable throws 
ArrayIndexOutOfBoundException
 Key: CODEC-313
 URL: https://issues.apache.org/jira/browse/CODEC-313
 Project: Commons Codec
  Issue Type: Bug
Reporter: Sheung Chi Chan


The {{encodeQuotedPrintable()}} method takes in a random byte array and 
processes it. If the provided {{strict}} boolean is true, it will go into the 
first branch. There is a for loop to loop through the byte array from the index 
0 to the index byte.length - 3. The index is then used directly in 
{{getUnsignedOctet}} method If the length of the byte array is less than 3, it 
will result in a negative index and cause ArrayIndexOutOfBoundsException in 
{{getUnsignedOctet()}} method call.

Possible fix could add a conditional check to ensure the index is never 
negative. It will simply return null if the byte array is too short (with a 
length less than 3) if {{strict}} value is true.

We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
[https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64358].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CODEC-312) MatchRatingApproachEncoder.encode throw StringIndexOutOfBound

2023-11-22 Thread Sheung Chi Chan (Jira)
Sheung Chi Chan created CODEC-312:
-

 Summary: MatchRatingApproachEncoder.encode throw 
StringIndexOutOfBound
 Key: CODEC-312
 URL: https://issues.apache.org/jira/browse/CODEC-312
 Project: Commons Codec
  Issue Type: Bug
Reporter: Sheung Chi Chan


The {{encode(String)}} method takes in a random String and checks if it is 
empty. It will go through a few rounds of processing if the given String is not 
empty. It does contain a check to ensure the String is not empty before 
processing. But it has some missing checks. Each of the 3 processing methods 
{{cleanName(name)}} / {{removeVowels(name)}} / {{removeDoubleConsonants(name)}} 
remove some characters from the String and could cause the string to become 
empty (length = 0). And that results in StringIndexOutOfBoundException when 
{{substring()}} method is called in the next processing method. For example, if 
the randomly provided string is {{{}..{}}}, it gets past the first checking in 
the encode method and enters the {{cleanName(name)}} method. The 
{{cleanName(name)}} method removes the two dots and returns an empty string. 
Without the additional checking, it causes the StringIndexOutOfBoundException 
in the {{substring()}} method call in the next {{removeVowels(name)}} method 
call cause the length of the string is 0.

Possible fix could add some conditional checking to ensure the string is not 
empty after each method call. If it is empty after any method call, it will 
simply return {{EMPTY}} and avoid continuing processing onto the next 
processing method.

We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
[https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64359].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CODEC-311) RefinedSoundex.getMappingCode throw ArrayIndexOutOfBoundException

2023-11-22 Thread Sheung Chi Chan (Jira)
Sheung Chi Chan created CODEC-311:
-

 Summary: RefinedSoundex.getMappingCode throw 
ArrayIndexOutOfBoundException
 Key: CODEC-311
 URL: https://issues.apache.org/jira/browse/CODEC-311
 Project: Commons Codec
  Issue Type: Bug
Reporter: Sheung Chi Chan


The {{getMappingCode(char)}} method takes in a random character retrieved from 
a string (through processing of {{encode(String)}} or {{soundex(String)}} 
method) and checks if it is a letter, then returns a mapping code from the 
{{soundexMapping}} array if it is a letter. But the checking contains a bug. 
The {{Character.isLetter()}} method will return true not only for English 
characters. For example, a char with character code 1689 will also make 
{{Character.isLetter()}} returns true. Using a character with large character 
code that passed the {{Character.isLetter()}} check and a way smaller 
{{soundexMapping}} array will cause ArrayIndexOutOfBoundException.

This possible fixes could add a conditional checking to ensure the index is 
never out of bounds from the configured {{soundexMapping}} array. If the 
calculated index goes out of bounds, it will simply return 0, just like the 
original logic when Character.isLetter() returns false.

We found this bug using fuzzing by way of OSS-Fuzz. It is reported at 
[https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64353].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1823076057

   One PR please, this one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1823061641

   > Hi @sanjanarampurkottur01 Hm, ok, then you should not only address the one 
file, but all files:
   > 
   > ```
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java:[159,23] 
(design) VisibilityModifier: Variable 'testField' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java:[172,24] 
(design) VisibilityModifier: Variable 'testField' must be private and have 
accessor methods.
   > [ERROR] src/test/java/org/apache/commons/dbutils/BaseTestCase.java:[68,25] 
(design) VisibilityModifier: Variable 'rs' must be private and have accessor 
methods.
   > [ERROR] src/test/java/org/apache/commons/dbutils/BaseTestCase.java:[73,25] 
(design) VisibilityModifier: Variable 'emptyResultSet' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/OutParameterTest.java:[42,23] (design) 
VisibilityModifier: Variable 'stmt' must be private and have accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/OutParameterTest.java:[44,26] (design) 
VisibilityModifier: Variable 'parameter' must be private and have accessor 
methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[50,22] 
(design) VisibilityModifier: Variable 'runner' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[51,18] 
(design) VisibilityModifier: Variable 'handler' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[54,16] 
(design) VisibilityModifier: Variable 'dataSource' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[56,16] 
(design) VisibilityModifier: Variable 'conn' must be private and have accessor 
methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[58,23] 
(design) VisibilityModifier: Variable 'prepStmt' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[60,15] 
(design) VisibilityModifier: Variable 'stmt' must be private and have accessor 
methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[62,23] 
(design) VisibilityModifier: Variable 'meta' must be private and have accessor 
methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[64,15] 
(design) VisibilityModifier: Variable 'results' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java:[65,27] 
(design) VisibilityModifier: Variable 'processor' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java:[67,23] 
(design) VisibilityModifier: Variable 'metaData' must be private and have 
accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java:[69,26] 
(design) VisibilityModifier: Variable 'propDescriptors' must be private and 
have accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[90,17] (design) 
VisibilityModifier: Variable 'runner' must be private and have accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[92,18] (design) 
VisibilityModifier: Variable 'handler' must be private and have accessor 
methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[95,16] (design) 
VisibilityModifier: Variable 'dataSource' must be private and have accessor 
methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[98,16] (design) 
VisibilityModifier: Variable 'conn' must be private and have accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[101,23] (design) 
VisibilityModifier: Variable 'prepStmt' must be private and have accessor 
methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[104,15] (design) 
VisibilityModifier: Variable 'stmt' must be private and have accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[107,23] (design) 
VisibilityModifier: Variable 'call' must be private and have accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[110,23] (design) 
VisibilityModifier: Variable 'meta' must be private and have accessor methods.
   > [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[113,15] (design) 
VisibilityModifier: Variable 'results' must be private and have accessor 
methods.
   > [ERROR] 

[jira] [Commented] (IO-822) I hope to add a file size tool class for converting units such as TB, GB, MB, etc, such as java.util.concurrent.TimeUnit.java

2023-11-22 Thread hellozrh (Jira)


[ 
https://issues.apache.org/jira/browse/IO-822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788795#comment-17788795
 ] 

hellozrh commented on IO-822:
-

Far more than that. FileUtils. bytCountToDisplaySize only supports converting 
byte size to a readable version. I have implemented a tool that can convert any 
size unit into a human readable version, and support file size unit conversion 
to and from each other. The implementation method refers to TimeUnit, adopts 
the feature of enumeration, simplifies the code, and has high efficiency.

> I hope to add a file size tool class for converting units such as TB, GB, MB, 
> etc,  such as java.util.concurrent.TimeUnit.java
> --
>
> Key: IO-822
> URL: https://issues.apache.org/jira/browse/IO-822
> Project: Commons IO
>  Issue Type: Wish
>  Components: Utilities
> Environment: java8+
>Reporter: hellozrh
>Priority: Minor
>  Labels: features
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> a tool for file size converting,  TB, GB, MB, KB convert to each other, 
> including Byte conversion to a size that is convenient for human reading。



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory merged PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402139176


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -53,6 +54,8 @@ public static ResultSet create(final ResultSetMetaData 
metaData, final Object[][
 
 private Boolean wasNull = Boolean.FALSE;
 
+private static final Set METHOD_NAMES = Set.of("isLast", 
"hashCode", "toString", "equals");

Review Comment:
   Make the Set immutable.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402139176


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -53,6 +54,8 @@ public static ResultSet create(final ResultSetMetaData 
metaData, final Object[][
 
 private Boolean wasNull = Boolean.FALSE;
 
+private static final Set METHOD_NAMES = Set.of("isLast", 
"hashCode", "toString", "equals");

Review Comment:
   Make the Set immutable.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IMAGING-337] Make ImageInfo state correct color type [commons-imaging]

2023-11-22 Thread via GitHub


garydgregory merged PR #337:
URL: https://github.com/apache/commons-imaging/pull/337


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402115817


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -265,64 +266,77 @@ protected String getString(final int columnIndex) throws 
SQLException {
 }
 
 @Override
-public Object invoke(final Object proxy, final Method method, final 
Object[] args) throws Throwable {
+public Object invoke(final Object proxy, final Method method, final 
Object[] args)
+throws Throwable {
 
 final String methodName = method.getName();
-
 if (methodName.equals("getMetaData")) {
 return this.getMetaData();
-
 }
 if (methodName.equals("next")) {
 return this.next();
-
 }
-if (methodName.equals("previous") || methodName.equals("close")) {
-
-} else if (methodName.equals("getBoolean")) {
-return this.getBoolean(columnIndex(args));
-
-} else if (methodName.equals("getByte")) {
-return this.getByte(columnIndex(args));
-
-} else if (methodName.equals("getDouble")) {
-return this.getDouble(columnIndex(args));
-
-} else if (methodName.equals("getFloat")) {
-return this.getFloat(columnIndex(args));
-
-} else if (methodName.equals("getInt")) {
-return this.getInt(columnIndex(args));
-
-} else if (methodName.equals("getLong")) {
-return this.getLong(columnIndex(args));
-
-} else if (methodName.equals("getObject")) {
-return this.getObject(columnIndex(args));
-
-} else if (methodName.equals("getShort")) {
-return this.getShort(columnIndex(args));
-
-} else if (methodName.equals("getString")) {
-return this.getString(columnIndex(args));
-
-} else if (methodName.equals("wasNull")) {
-return this.wasNull();
+if (methodName.equals("previous")) {
+// Handle previous method
+} else if (methodName.equals("close")) {
+// Handle close method
+} else if (isColumnMethod(methodName)) {
+return handleColumnMethod(methodName, args);
+} else if (isNonColumnMethod(methodName)) {
+return handleNonColumnMethod(methodName, proxy, args);
+}
+throw new UnsupportedOperationException("Unsupported method: " + 
methodName);
+}
 
-} else if (methodName.equals("isLast")) {
-return this.isLast();
+private boolean isColumnMethod(String methodName) {
+return methodName.startsWith("get") || methodName.equals("wasNull");
+}
 
-} else if (methodName.equals("hashCode")) {
-return Integer.valueOf(System.identityHashCode(proxy));
+private Object handleColumnMethod(String methodName, final Object[] args) 
throws SQLException {
+switch (methodName) {
+case "getBoolean":
+return this.getBoolean(columnIndex(args));
+case "getByte":
+return this.getByte(columnIndex(args));
+case "getDouble":
+return this.getDouble(columnIndex(args));
+case "getFloat":
+return this.getFloat(columnIndex(args));
+case "getInt":
+return this.getInt(columnIndex(args));
+case "getLong":
+return this.getLong(columnIndex(args));
+case "getObject":
+return this.getObject(columnIndex(args));
+case "getShort":
+return this.getShort(columnIndex(args));
+case "getString":
+return this.getString(columnIndex(args));
+case "wasNull":
+return this.wasNull();
+default:
+throw new UnsupportedOperationException("Unsupported column 
method: " + methodName);
+}
+}
 
-} else if (methodName.equals("toString")) {
-return "MockResultSet " + System.identityHashCode(proxy);
+private boolean isNonColumnMethod(String methodName) {
+Set methodNames = Set.of("isLast", "hashCode", "toString", 
"equals");

Review Comment:
   Modified this as well. Thanks for noticing it. Static field will be a better 
choice. Thank you! 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402094200


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -265,64 +266,77 @@ protected String getString(final int columnIndex) throws 
SQLException {
 }
 
 @Override
-public Object invoke(final Object proxy, final Method method, final 
Object[] args) throws Throwable {
+public Object invoke(final Object proxy, final Method method, final 
Object[] args)
+throws Throwable {
 
 final String methodName = method.getName();
-
 if (methodName.equals("getMetaData")) {
 return this.getMetaData();
-
 }
 if (methodName.equals("next")) {
 return this.next();
-
 }
-if (methodName.equals("previous") || methodName.equals("close")) {
-
-} else if (methodName.equals("getBoolean")) {
-return this.getBoolean(columnIndex(args));
-
-} else if (methodName.equals("getByte")) {
-return this.getByte(columnIndex(args));
-
-} else if (methodName.equals("getDouble")) {
-return this.getDouble(columnIndex(args));
-
-} else if (methodName.equals("getFloat")) {
-return this.getFloat(columnIndex(args));
-
-} else if (methodName.equals("getInt")) {
-return this.getInt(columnIndex(args));
-
-} else if (methodName.equals("getLong")) {
-return this.getLong(columnIndex(args));
-
-} else if (methodName.equals("getObject")) {
-return this.getObject(columnIndex(args));
-
-} else if (methodName.equals("getShort")) {
-return this.getShort(columnIndex(args));
-
-} else if (methodName.equals("getString")) {
-return this.getString(columnIndex(args));
-
-} else if (methodName.equals("wasNull")) {
-return this.wasNull();
+if (methodName.equals("previous")) {
+// Handle previous method
+} else if (methodName.equals("close")) {
+// Handle close method
+} else if (isColumnMethod(methodName)) {
+return handleColumnMethod(methodName, args);
+} else if (isNonColumnMethod(methodName)) {
+return handleNonColumnMethod(methodName, proxy, args);
+}
+throw new UnsupportedOperationException("Unsupported method: " + 
methodName);
+}
 
-} else if (methodName.equals("isLast")) {
-return this.isLast();
+private boolean isColumnMethod(String methodName) {
+return methodName.startsWith("get") || methodName.equals("wasNull");
+}
 
-} else if (methodName.equals("hashCode")) {
-return Integer.valueOf(System.identityHashCode(proxy));
+private Object handleColumnMethod(String methodName, final Object[] args) 
throws SQLException {
+switch (methodName) {
+case "getBoolean":
+return this.getBoolean(columnIndex(args));
+case "getByte":
+return this.getByte(columnIndex(args));
+case "getDouble":
+return this.getDouble(columnIndex(args));
+case "getFloat":
+return this.getFloat(columnIndex(args));
+case "getInt":
+return this.getInt(columnIndex(args));
+case "getLong":
+return this.getLong(columnIndex(args));
+case "getObject":
+return this.getObject(columnIndex(args));
+case "getShort":
+return this.getShort(columnIndex(args));
+case "getString":
+return this.getString(columnIndex(args));
+case "wasNull":
+return this.wasNull();
+default:
+throw new UnsupportedOperationException("Unsupported column 
method: " + methodName);
+}
+}
 
-} else if (methodName.equals("toString")) {
-return "MockResultSet " + System.identityHashCode(proxy);
+private boolean isNonColumnMethod(String methodName) {
+Set methodNames = Set.of("isLast", "hashCode", "toString", 
"equals");

Review Comment:
   This Set does not need to be created on each invocation, just make it a 
constant and immutable.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IMAGING-337] Make ImageInfo state correct color type [commons-imaging]

2023-11-22 Thread via GitHub


gwlucastrig commented on PR #337:
URL: https://github.com/apache/commons-imaging/pull/337#issuecomment-1822815480

   Thanks for the comments.  Changes were made and a new commit pushed to Github


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IMAGING-337] Make ImageInfo state correct color type [commons-imaging]

2023-11-22 Thread via GitHub


gwlucastrig commented on code in PR #337:
URL: https://github.com/apache/commons-imaging/pull/337#discussion_r1402084313


##
src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadImageInfoTest.java:
##
@@ -0,0 +1,90 @@
+/*
+ * 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.imaging.formats.tiff;
+
+import java.io.File;
+import org.apache.commons.imaging.ImageInfo;
+import org.apache.commons.imaging.Imaging;
+import org.apache.commons.imaging.ImagingTestConstants;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Performs a test on the ImageInfo returned from TIFF to confirm
+ * that it contains the specified value for a particular target.
+ * This test is used to confirm that the TiffImageParser is correctly
+ * interpreting the ImageInfo values.
+ */
+public class TiffReadImageInfoTest extends TiffBaseTest {
+
+// The form of the test set is
+//0.   target file name
+//1.   Parameter field in ImageInfo
+//2.   Expected value
+static final String[][] testSet = {
+{"1/matthew2.tif", "Color Type", "Black and White"},
+{"7/Oregon Scientific DS6639 - DSC_0307 - small - CMYK.tiff", "Color 
Type", "CMYK"},
+{"10/Imaging247.tiff", "Uses Palette", "true"},
+{"12/TransparencyTestStripAssociated.tif", "Is Transparent", "true"},
+{"14/TestJpegStrips.tiff", "Color Type", "YCbCr"}
+

Review Comment:
   done



##
src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadImageInfoTest.java:
##
@@ -0,0 +1,90 @@
+/*
+ * 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.imaging.formats.tiff;
+
+import java.io.File;
+import org.apache.commons.imaging.ImageInfo;
+import org.apache.commons.imaging.Imaging;
+import org.apache.commons.imaging.ImagingTestConstants;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Performs a test on the ImageInfo returned from TIFF to confirm
+ * that it contains the specified value for a particular target.
+ * This test is used to confirm that the TiffImageParser is correctly
+ * interpreting the ImageInfo values.
+ */
+public class TiffReadImageInfoTest extends TiffBaseTest {
+
+// The form of the test set is
+//0.   target file name
+//1.   Parameter field in ImageInfo
+//2.   Expected value
+static final String[][] testSet = {
+{"1/matthew2.tif", "Color Type", "Black and White"},
+{"7/Oregon Scientific DS6639 - DSC_0307 - small - CMYK.tiff", "Color 
Type", "CMYK"},
+{"10/Imaging247.tiff", "Uses Palette", "true"},
+{"12/TransparencyTestStripAssociated.tif", "Is Transparent", "true"},
+{"14/TestJpegStrips.tiff", "Color Type", "YCbCr"}
+
+};
+
+/**
+ * Gets the value for the target data field within the ImageInfo string.
+ * This method expects data fields to be given in the form:
+ * parameter name, colon, value, end-of-line
+ *
+ * @param info a valid instance obtained from TiffImageParser
+ * @param target the target data field string
+ * @return the value
+ */
+private String getValue(ImageInfo info, String target) {
+String s = info.toString();
+int i = s.indexOf(target);
+if (i < 0) {
+return "";
+}
+int j = s.indexOf(':', i);
+if (j 

Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402082036


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -265,64 +266,86 @@ protected String getString(final int columnIndex) throws 
SQLException {
 }
 
 @Override
-public Object invoke(final Object proxy, final Method method, final 
Object[] args) throws Throwable {
+public Object invoke(final Object proxy, final Method method, final 
Object[] args)
+throws Throwable {
 
 final String methodName = method.getName();
-
 if (methodName.equals("getMetaData")) {
-return this.getMetaData();
-
+return handleGetMetaData();
 }
 if (methodName.equals("next")) {
-return this.next();
-
+return handleNext();
 }
-if (methodName.equals("previous") || methodName.equals("close")) {
-
-} else if (methodName.equals("getBoolean")) {
-return this.getBoolean(columnIndex(args));
-
-} else if (methodName.equals("getByte")) {
-return this.getByte(columnIndex(args));
-
-} else if (methodName.equals("getDouble")) {
-return this.getDouble(columnIndex(args));
-
-} else if (methodName.equals("getFloat")) {
-return this.getFloat(columnIndex(args));
-
-} else if (methodName.equals("getInt")) {
-return this.getInt(columnIndex(args));
-
-} else if (methodName.equals("getLong")) {
-return this.getLong(columnIndex(args));
-
-} else if (methodName.equals("getObject")) {
-return this.getObject(columnIndex(args));
-
-} else if (methodName.equals("getShort")) {
-return this.getShort(columnIndex(args));
+if (methodName.equals("previous")) {
+// Handle previous method
+} else if (methodName.equals("close")) {
+// Handle close method
+} else if (isColumnMethod(methodName)) {
+return handleColumnMethod(methodName, args);
+} else if (isNonColumnMethod(methodName)) {
+return handleNonColumnMethod(methodName, proxy, args);
+}
+throw new UnsupportedOperationException("Unsupported method: " + 
methodName);
+}
 
-} else if (methodName.equals("getString")) {
-return this.getString(columnIndex(args));
+// Define methods for handling specific cases
+private Object handleGetMetaData() throws SQLException {
+return this.getMetaData();
+}
 
-} else if (methodName.equals("wasNull")) {
-return this.wasNull();
+private Object handleNext() throws SQLException {

Review Comment:
   Resolved this as well!! 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402081588


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -265,64 +266,86 @@ protected String getString(final int columnIndex) throws 
SQLException {
 }
 
 @Override
-public Object invoke(final Object proxy, final Method method, final 
Object[] args) throws Throwable {
+public Object invoke(final Object proxy, final Method method, final 
Object[] args)
+throws Throwable {
 
 final String methodName = method.getName();
-
 if (methodName.equals("getMetaData")) {
-return this.getMetaData();
-
+return handleGetMetaData();
 }
 if (methodName.equals("next")) {
-return this.next();
-
+return handleNext();
 }
-if (methodName.equals("previous") || methodName.equals("close")) {
-
-} else if (methodName.equals("getBoolean")) {
-return this.getBoolean(columnIndex(args));
-
-} else if (methodName.equals("getByte")) {
-return this.getByte(columnIndex(args));
-
-} else if (methodName.equals("getDouble")) {
-return this.getDouble(columnIndex(args));
-
-} else if (methodName.equals("getFloat")) {
-return this.getFloat(columnIndex(args));
-
-} else if (methodName.equals("getInt")) {
-return this.getInt(columnIndex(args));
-
-} else if (methodName.equals("getLong")) {
-return this.getLong(columnIndex(args));
-
-} else if (methodName.equals("getObject")) {
-return this.getObject(columnIndex(args));
-
-} else if (methodName.equals("getShort")) {
-return this.getShort(columnIndex(args));
+if (methodName.equals("previous")) {
+// Handle previous method
+} else if (methodName.equals("close")) {
+// Handle close method
+} else if (isColumnMethod(methodName)) {
+return handleColumnMethod(methodName, args);
+} else if (isNonColumnMethod(methodName)) {
+return handleNonColumnMethod(methodName, proxy, args);
+}
+throw new UnsupportedOperationException("Unsupported method: " + 
methodName);
+}
 
-} else if (methodName.equals("getString")) {
-return this.getString(columnIndex(args));
+// Define methods for handling specific cases
+private Object handleGetMetaData() throws SQLException {

Review Comment:
   Resolved it. Thank you :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Commented] (IO-822) I hope to add a file size tool class for converting units such as TB, GB, MB, etc, such as java.util.concurrent.TimeUnit.java

2023-11-22 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/IO-822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788780#comment-17788780
 ] 

Gary D. Gregory commented on IO-822:


Sounds like a duplicate of {{FileUtils.byteCountToDisplaySize(...)}}?

> I hope to add a file size tool class for converting units such as TB, GB, MB, 
> etc,  such as java.util.concurrent.TimeUnit.java
> --
>
> Key: IO-822
> URL: https://issues.apache.org/jira/browse/IO-822
> Project: Commons IO
>  Issue Type: Wish
>  Components: Utilities
> Environment: java8+
>Reporter: hellozrh
>Priority: Minor
>  Labels: features
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> a tool for file size converting,  TB, GB, MB, KB convert to each other, 
> including Byte conversion to a size that is convenient for human reading。



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Switch on String instead of cascading if-else [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402070369


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -265,64 +266,86 @@ protected String getString(final int columnIndex) throws 
SQLException {
 }
 
 @Override
-public Object invoke(final Object proxy, final Method method, final 
Object[] args) throws Throwable {
+public Object invoke(final Object proxy, final Method method, final 
Object[] args)
+throws Throwable {
 
 final String methodName = method.getName();
-
 if (methodName.equals("getMetaData")) {
-return this.getMetaData();
-
+return handleGetMetaData();
 }
 if (methodName.equals("next")) {
-return this.next();
-
+return handleNext();
 }
-if (methodName.equals("previous") || methodName.equals("close")) {
-
-} else if (methodName.equals("getBoolean")) {
-return this.getBoolean(columnIndex(args));
-
-} else if (methodName.equals("getByte")) {
-return this.getByte(columnIndex(args));
-
-} else if (methodName.equals("getDouble")) {
-return this.getDouble(columnIndex(args));
-
-} else if (methodName.equals("getFloat")) {
-return this.getFloat(columnIndex(args));
-
-} else if (methodName.equals("getInt")) {
-return this.getInt(columnIndex(args));
-
-} else if (methodName.equals("getLong")) {
-return this.getLong(columnIndex(args));
-
-} else if (methodName.equals("getObject")) {
-return this.getObject(columnIndex(args));
-
-} else if (methodName.equals("getShort")) {
-return this.getShort(columnIndex(args));
+if (methodName.equals("previous")) {
+// Handle previous method
+} else if (methodName.equals("close")) {
+// Handle close method
+} else if (isColumnMethod(methodName)) {
+return handleColumnMethod(methodName, args);
+} else if (isNonColumnMethod(methodName)) {
+return handleNonColumnMethod(methodName, proxy, args);
+}
+throw new UnsupportedOperationException("Unsupported method: " + 
methodName);
+}
 
-} else if (methodName.equals("getString")) {
-return this.getString(columnIndex(args));
+// Define methods for handling specific cases
+private Object handleGetMetaData() throws SQLException {

Review Comment:
   This is superfluous IMO; just leave the implementation inlined as it was.



##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -265,64 +266,86 @@ protected String getString(final int columnIndex) throws 
SQLException {
 }
 
 @Override
-public Object invoke(final Object proxy, final Method method, final 
Object[] args) throws Throwable {
+public Object invoke(final Object proxy, final Method method, final 
Object[] args)
+throws Throwable {
 
 final String methodName = method.getName();
-
 if (methodName.equals("getMetaData")) {
-return this.getMetaData();
-
+return handleGetMetaData();
 }
 if (methodName.equals("next")) {
-return this.next();
-
+return handleNext();
 }
-if (methodName.equals("previous") || methodName.equals("close")) {
-
-} else if (methodName.equals("getBoolean")) {
-return this.getBoolean(columnIndex(args));
-
-} else if (methodName.equals("getByte")) {
-return this.getByte(columnIndex(args));
-
-} else if (methodName.equals("getDouble")) {
-return this.getDouble(columnIndex(args));
-
-} else if (methodName.equals("getFloat")) {
-return this.getFloat(columnIndex(args));
-
-} else if (methodName.equals("getInt")) {
-return this.getInt(columnIndex(args));
-
-} else if (methodName.equals("getLong")) {
-return this.getLong(columnIndex(args));
-
-} else if (methodName.equals("getObject")) {
-return this.getObject(columnIndex(args));
-
-} else if (methodName.equals("getShort")) {
-return this.getShort(columnIndex(args));
+if (methodName.equals("previous")) {
+// Handle previous method
+} else if (methodName.equals("close")) {
+// Handle close method
+} else if (isColumnMethod(methodName)) {
+return handleColumnMethod(methodName, args);
+} else if (isNonColumnMethod(methodName)) {
+return handleNonColumnMethod(methodName, proxy, args);
+}
+throw new UnsupportedOperationException("Unsupported method: " + 
methodName);
+}
 
-} else if (methodName.equals("getString")) {
-return this.getString(columnIndex(args));
+// Define methods for 

[jira] [Commented] (IO-822) I hope to add a file size tool class for converting units such as TB, GB, MB, etc, such as java.util.concurrent.TimeUnit.java

2023-11-22 Thread hellozrh (Jira)


[ 
https://issues.apache.org/jira/browse/IO-822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788779#comment-17788779
 ] 

hellozrh commented on IO-822:
-

After passing the test, I will submit the code to Github

> I hope to add a file size tool class for converting units such as TB, GB, MB, 
> etc,  such as java.util.concurrent.TimeUnit.java
> --
>
> Key: IO-822
> URL: https://issues.apache.org/jira/browse/IO-822
> Project: Commons IO
>  Issue Type: Wish
>  Components: Utilities
> Environment: java8+
>Reporter: hellozrh
>Priority: Minor
>  Labels: features
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> a tool for file size converting,  TB, GB, MB, KB convert to each other, 
> including Byte conversion to a size that is convenient for human reading。



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402062601


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -21,10 +21,7 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;

Review Comment:
   @garydgregory , 

   Fixed it :) 
   
   Kindly, review the same. Thank you. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (IO-822) I hope to add a file size tool class for converting units such as TB, GB, MB, etc, such as java.util.concurrent.TimeUnit.java

2023-11-22 Thread hellozrh (Jira)
hellozrh created IO-822:
---

 Summary: I hope to add a file size tool class for converting units 
such as TB, GB, MB, etc,  such as java.util.concurrent.TimeUnit.java
 Key: IO-822
 URL: https://issues.apache.org/jira/browse/IO-822
 Project: Commons IO
  Issue Type: Wish
  Components: Utilities
 Environment: java8+
Reporter: hellozrh


a tool for file size converting,  TB, GB, MB, KB convert to each other, 
including Byte conversion to a size that is convenient for human reading。



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1822776365

   Hi @sanjanarampurkottur01 
   Hm, ok, then you should not only address the one file, but all files:
   ```
   [ERROR] 
src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java:[159,23] 
(design) VisibilityModifier: Variable 'testField' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java:[172,24] 
(design) VisibilityModifier: Variable 'testField' must be private and have 
accessor methods.
   [ERROR] src/test/java/org/apache/commons/dbutils/BaseTestCase.java:[68,25] 
(design) VisibilityModifier: Variable 'rs' must be private and have accessor 
methods.
   [ERROR] src/test/java/org/apache/commons/dbutils/BaseTestCase.java:[73,25] 
(design) VisibilityModifier: Variable 'emptyResultSet' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/OutParameterTest.java:[42,23] (design) 
VisibilityModifier: Variable 'stmt' must be private and have accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/OutParameterTest.java:[44,26] (design) 
VisibilityModifier: Variable 'parameter' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[50,22] 
(design) VisibilityModifier: Variable 'runner' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[51,18] 
(design) VisibilityModifier: Variable 'handler' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[54,16] 
(design) VisibilityModifier: Variable 'dataSource' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[56,16] 
(design) VisibilityModifier: Variable 'conn' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[58,23] 
(design) VisibilityModifier: Variable 'prepStmt' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[60,15] 
(design) VisibilityModifier: Variable 'stmt' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[62,23] 
(design) VisibilityModifier: Variable 'meta' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java:[64,15] 
(design) VisibilityModifier: Variable 'results' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java:[65,27] 
(design) VisibilityModifier: Variable 'processor' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java:[67,23] 
(design) VisibilityModifier: Variable 'metaData' must be private and have 
accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java:[69,26] 
(design) VisibilityModifier: Variable 'propDescriptors' must be private and 
have accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[90,17] (design) 
VisibilityModifier: Variable 'runner' must be private and have accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[92,18] (design) 
VisibilityModifier: Variable 'handler' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[95,16] (design) 
VisibilityModifier: Variable 'dataSource' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[98,16] (design) 
VisibilityModifier: Variable 'conn' must be private and have accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[101,23] (design) 
VisibilityModifier: Variable 'prepStmt' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[104,15] (design) 
VisibilityModifier: Variable 'stmt' must be private and have accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[107,23] (design) 
VisibilityModifier: Variable 'call' must be private and have accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[110,23] (design) 
VisibilityModifier: Variable 'meta' must be private and have accessor methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[113,15] (design) 
VisibilityModifier: Variable 'results' must be private and have accessor 
methods.
   [ERROR] 
src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java:[116,23] (design) 
VisibilityModifier: Variable 'resultsMeta' must be 

Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402050005


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -21,10 +21,7 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;

Review Comment:
   and please rebase on master ;-) TY!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402049550


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -21,10 +21,7 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;

Review Comment:
   Sure @garydgregory , 
   
   I'm currently addressing the issue, and I appreciate your prompt review. 
   
   Thank you.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402045445


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -21,10 +21,7 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;

Review Comment:
   Please Don't change to star (`*`) imports.



##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -21,10 +21,7 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;

Review Comment:
   Please don't change to star (`*`) imports.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#discussion_r1402045445


##
src/test/java/org/apache/commons/dbutils/MockResultSet.java:
##
@@ -21,10 +21,7 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;

Review Comment:
   Don't change to start imports.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1822760135

   > Hello @sanjanarampurkottur01 Why? This is test code and shows how client 
classes could be laid out in the wild, with proper or improper adherence to 
coding guidelines.
   
   Hello @garydgregory , 
   In my understanding, ensuring optimal code quality across all packages, 
including test files, is crucial. Therefore, I've decided to refactor the code 
and incorporate the necessary changes. However, if we neglect the test files, 
it ultimately comes down to maintaining high overall code quality.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Commented] (JEXL-414) SoftCache may suffer from race conditions

2023-11-22 Thread Holger Sunke (Jira)


[ 
https://issues.apache.org/jira/browse/JEXL-414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788775#comment-17788775
 ] 

Holger Sunke commented on JEXL-414:
---

Thank you for quick action. Looking at the source it looks very solid and 
should remove any race condition.

Do you have some kind of reproducible concurrent performance test to compare 
old implementation and both new variants?

> SoftCache may suffer from race conditions
> -
>
> Key: JEXL-414
> URL: https://issues.apache.org/jira/browse/JEXL-414
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.3
>Reporter: Holger Sunke
>Assignee: Henri Biestro
>Priority: Major
> Fix For: 3.3.1
>
>
> I found the SoftCache used from within the JEXL class Engine to be very 
> relevant for overall performance (depending on the application) on the one 
> hand, but on the other hand it may suffer from race conditions.
> While solid efford was taken to protect it from race conditions by 
> surrounding access using a ReadWriteLock, parallel read access actually do 
> reach out on a LinkedHashMap having set accessOrder=true. This means that on 
> every potentially parallel, non serialized invocation of LinkedHashMap#get 
> the order of elements is modified to bring the last accessed element down to 
> the tail of the internal linked list structure and modCount is incremented.
>  
> In our application rendering web templates, we observe multiple of 1 
> access on the SoftCache per page impression and multiple of 10 page 
> impressions per second per JVM instance.
> Not sure whether this is result of race condition claimed above, in heapdumps 
> of that application I observed the LinkedHashMap used within SoftCache having 
> a size of ~9500 elements while the SoftCache#size is set to limit the cache 
> to 5000 elements. Additionaly the LinkedHashMap#modCount shows up with 
> arbitrary giant positive or negative numbers, telling me it has overflown 
> already after some hours of application uptime.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [IMAGING-337] Make ImageInfo state correct color type [commons-imaging]

2023-11-22 Thread via GitHub


garydgregory commented on code in PR #337:
URL: https://github.com/apache/commons-imaging/pull/337#discussion_r1402031806


##
src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadImageInfoTest.java:
##
@@ -0,0 +1,90 @@
+/*
+ * 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.imaging.formats.tiff;
+
+import java.io.File;
+import org.apache.commons.imaging.ImageInfo;
+import org.apache.commons.imaging.Imaging;
+import org.apache.commons.imaging.ImagingTestConstants;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Performs a test on the ImageInfo returned from TIFF to confirm
+ * that it contains the specified value for a particular target.
+ * This test is used to confirm that the TiffImageParser is correctly
+ * interpreting the ImageInfo values.
+ */
+public class TiffReadImageInfoTest extends TiffBaseTest {
+
+// The form of the test set is
+//0.   target file name
+//1.   Parameter field in ImageInfo
+//2.   Expected value
+static final String[][] testSet = {
+{"1/matthew2.tif", "Color Type", "Black and White"},
+{"7/Oregon Scientific DS6639 - DSC_0307 - small - CMYK.tiff", "Color 
Type", "CMYK"},
+{"10/Imaging247.tiff", "Uses Palette", "true"},
+{"12/TransparencyTestStripAssociated.tif", "Is Transparent", "true"},
+{"14/TestJpegStrips.tiff", "Color Type", "YCbCr"}
+

Review Comment:
   No need for extra whitespace.



##
src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadImageInfoTest.java:
##
@@ -0,0 +1,90 @@
+/*
+ * 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.imaging.formats.tiff;
+
+import java.io.File;
+import org.apache.commons.imaging.ImageInfo;
+import org.apache.commons.imaging.Imaging;
+import org.apache.commons.imaging.ImagingTestConstants;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Performs a test on the ImageInfo returned from TIFF to confirm
+ * that it contains the specified value for a particular target.
+ * This test is used to confirm that the TiffImageParser is correctly
+ * interpreting the ImageInfo values.
+ */
+public class TiffReadImageInfoTest extends TiffBaseTest {
+
+// The form of the test set is
+//0.   target file name
+//1.   Parameter field in ImageInfo
+//2.   Expected value
+static final String[][] testSet = {
+{"1/matthew2.tif", "Color Type", "Black and White"},
+{"7/Oregon Scientific DS6639 - DSC_0307 - small - CMYK.tiff", "Color 
Type", "CMYK"},
+{"10/Imaging247.tiff", "Uses Palette", "true"},
+{"12/TransparencyTestStripAssociated.tif", "Is Transparent", "true"},
+{"14/TestJpegStrips.tiff", "Color Type", "YCbCr"}
+
+};
+
+/**
+ * Gets the value for the target data field within the ImageInfo string.
+ * This method expects data fields to be given in the form:
+ * parameter name, colon, value, end-of-line
+ *
+ * @param info a valid instance obtained from TiffImageParser
+ * @param target the target data field string
+ * @return the value
+ */
+private String getValue(ImageInfo info, String target) {
+String s = info.toString();
+int i = s.indexOf(target);
+if (i < 0) {
+return "";
+}
+int j = 

Re: [PR] Refactoring deficient encapsulation using encapsulate field technique [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on PR #222:
URL: https://github.com/apache/commons-dbutils/pull/222#issuecomment-1822722013

   Hello @sanjanarampurkottur01 
   Why?
   This is test code and shows how client classes could be laid out in the 
wild, with proper or improper adherence to coding guidelines.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IMAGING-337] Make ImageInfo state correct color type [commons-imaging]

2023-11-22 Thread via GitHub


gwlucastrig commented on PR #337:
URL: https://github.com/apache/commons-imaging/pull/337#issuecomment-1822713296

   Pushed a new commit that addresses the checkstyle issues. Apologies.  I made 
a minor code change after my last checkstyle:check and foolishly assumed that 
nothing could go wrong.
   
   Since I was already working on the TiffImageParser class, I also added the 
class-level Javadoc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#issuecomment-1822600824

   Hi Gary,
   
   I have made the necessary changes to
   https://github.com/apache/commons-dbutils/pull/220, I kindly request you to
   review and approve the same.
   My sincere apologies for the same.
   
   Thank you.
   
   Sincerely,
   Sanjana Rampur Kottur
   
   On Wed, 22 Nov 2023 at 07:13, Sanjana RK ***@***.***>
   wrote:
   
   > Hi Gary,
   >
   > I am extremely sorry about that, I will change the formatting style and
   > let you know as soon as possible, once I push the changes.
   >
   > Thank you.
   >
   > Sincerely,
   > Sanjana Rampur Kottur
   >
   > On Wed, 22 Nov 2023 at 07:09, Gary Gregory ***@***.***>
   > wrote:
   >
   >> @sanjanarampurkottur01 
   >> Please don't change the formatting style, it makes PRs noisy and takes
   >> longer and is harder to review.
   >>
   >> —
   >> Reply to this email directly, view it on GitHub
   >> 
,
   >> or unsubscribe
   >> 

   >> .
   >> You are receiving this because you were mentioned.Message ID:
   >> ***@***.***>
   >>
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#issuecomment-1822576411

   > @sanjanarampurkottur01 Please don't change the formatting style, it makes 
PRs noisy and takes longer and is harder to review.
   
   @garydgregory , I will fix that andl et you know. I am extremely sorry for 
the inconvenience caused. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


sanjanarampurkottur01 commented on PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#issuecomment-1822571926

   Hi Gary,
   
   I am extremely sorry about that, I will change the formatting style and let
   you know as soon as possible, once I push the changes.
   
   Thank you.
   
   Sincerely,
   Sanjana Rampur Kottur
   
   On Wed, 22 Nov 2023 at 07:09, Gary Gregory ***@***.***> wrote:
   
   > @sanjanarampurkottur01 
   > Please don't change the formatting style, it makes PRs noisy and takes
   > longer and is harder to review.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > 
,
   > or unsubscribe
   > 

   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Refactoring/push variable method technique [commons-dbutils]

2023-11-22 Thread via GitHub


garydgregory commented on PR #220:
URL: https://github.com/apache/commons-dbutils/pull/220#issuecomment-1822565139

   @sanjanarampurkottur01 
   Please don't change the formatting style, it makes PRs noisy and takes 
longer and is harder to review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Commented] (CRYPTO-164) Add Support for OpenSSL 3.0.x

2023-11-22 Thread Sebb (Jira)


[ 
https://issues.apache.org/jira/browse/CRYPTO-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17788678#comment-17788678
 ] 

Sebb commented on CRYPTO-164:
-

Looks like this is already being tested on ubuntu-latest.

> Add Support for OpenSSL 3.0.x
> -
>
> Key: CRYPTO-164
> URL: https://issues.apache.org/jira/browse/CRYPTO-164
> Project: Commons Crypto
>  Issue Type: New Feature
>  Components: Native
>Affects Versions: 1.1.0
>Reporter: Alex Remily
>Priority: Major
>
> OpenSSL has released version 3.0.x.  Commons Crypto should support this 
> release.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)