This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push:
new e8901b781 org.apache.commons.compress.utils.ParsingUtils should set
the cause of the exceptions it throws
e8901b781 is described below
commit e8901b781728528260c5b3a6a24db73599b93f3c
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Mar 13 15:23:54 2026 -0400
org.apache.commons.compress.utils.ParsingUtils should set the cause of
the exceptions it throws
---
src/changes/changes.xml | 1 +
src/main/java/org/apache/commons/compress/utils/ParsingUtils.java | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b9cfca06b..561fe603f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -137,6 +137,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory">CPUTF8 is
missing optional hashCode() and equals() to match its
Comparable.compareTo().</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Pack200 class
IcBands.IcTuple implements equals() but not hashCode().</action>
<action type="fix" dev="ggregory" due-to="Martin Wiesner">Fix typos in
Javadoc and comments #761.</action>
+ <action type="fix" dev="ggregory" due-to="Gary
Gregory">org.apache.commons.compress.utils.ParsingUtils should set the cause of
the exceptions it throws.</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add
MemoryLimitException.MemoryLimitException(long, long).</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add
CompressException.CompressException(String, Object...).</action>
diff --git a/src/main/java/org/apache/commons/compress/utils/ParsingUtils.java
b/src/main/java/org/apache/commons/compress/utils/ParsingUtils.java
index 7550edf3c..9e7290f50 100644
--- a/src/main/java/org/apache/commons/compress/utils/ParsingUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/ParsingUtils.java
@@ -49,8 +49,8 @@ public static int parseIntValue(final String value) throws
IOException {
public static int parseIntValue(final String value, final int radix)
throws IOException {
try {
return Integer.parseInt(value, radix);
- } catch (final NumberFormatException exp) {
- throw new IOException("Unable to parse int from string value: " +
value);
+ } catch (final NumberFormatException e) {
+ throw new IOException("Unable to parse int from string value: " +
value, e);
}
}
@@ -76,8 +76,8 @@ public static long parseLongValue(final String value) throws
IOException {
public static long parseLongValue(final String value, final int radix)
throws IOException {
try {
return Long.parseLong(value, radix);
- } catch (final NumberFormatException exp) {
- throw new IOException("Unable to parse long from string value: " +
value);
+ } catch (final NumberFormatException e) {
+ throw new IOException("Unable to parse long from string value: " +
value, e);
}
}