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-exec.git
The following commit(s) were added to refs/heads/master by this push: new 9b77588 Throw a RuntimeException subclass instead of RuntimeException 9b77588 is described below commit 9b77588bff311cc571a96bbe981f4c7e3bbc165c Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Thu Jul 6 15:24:13 2023 -0400 Throw a RuntimeException subclass instead of RuntimeException --- src/main/java/org/apache/commons/exec/ExecuteWatchdog.java | 2 +- src/main/java/org/apache/commons/exec/OS.java | 2 +- src/main/java/org/apache/commons/exec/util/StringUtils.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java b/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java index 66f0d50..2b6017a 100644 --- a/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java +++ b/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java @@ -240,7 +240,7 @@ public class ExecuteWatchdog implements TimeoutObserver { try { this.wait(); } catch (final InterruptedException e) { - throw new RuntimeException(e.getMessage()); + throw new IllegalStateException(e.getMessage(), e); } } } diff --git a/src/main/java/org/apache/commons/exec/OS.java b/src/main/java/org/apache/commons/exec/OS.java index 620639d..3e0e851 100644 --- a/src/main/java/org/apache/commons/exec/OS.java +++ b/src/main/java/org/apache/commons/exec/OS.java @@ -247,7 +247,7 @@ public final class OS { } else if (family.equals(FAMILY_VMS)) { isFamily = OS_NAME.contains(FAMILY_VMS); } else { - throw new RuntimeException( + throw new IllegalArgumentException( "Don\'t know how to detect os family \"" + family + "\""); } diff --git a/src/main/java/org/apache/commons/exec/util/StringUtils.java b/src/main/java/org/apache/commons/exec/util/StringUtils.java index ed33f56..937a8cd 100644 --- a/src/main/java/org/apache/commons/exec/util/StringUtils.java +++ b/src/main/java/org/apache/commons/exec/util/StringUtils.java @@ -118,7 +118,7 @@ public class StringUtils { } else { if (!isLenient) { // complain that no variable was found - throw new RuntimeException("No value found for : " + nameBuf); + throw new IllegalArgumentException("No value found for : " + nameBuf); } // just append the unresolved variable declaration argBuf.append("${").append(nameBuf.toString()).append("}"); @@ -127,7 +127,7 @@ public class StringUtils { del = argStr.charAt(cIdx); if (del != '}') { - throw new RuntimeException("Delimiter not found for : " + nameBuf); + throw new IllegalArgumentException("Delimiter not found for : " + nameBuf); } } } else {