You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/06/23 14:48:47 UTC

[commons-jci] 02/02: GrrovyJavaCompiler.compile() now throws IllegalStateException instead of RuntimeException when there is no compiler available

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-jci.git

commit 0cb56a5f0dac90bb0535debf8279a882af2b0cd2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 23 10:36:04 2023 -0400

    GrrovyJavaCompiler.compile() now throws IllegalStateException instead of
    RuntimeException when there is no compiler available
---
 .../java/org/apache/commons/jci2/compilers/GroovyJavaCompiler.java     | 2 +-
 src/changes/changes.xml                                                | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/compilers/groovy/src/main/java/org/apache/commons/jci2/compilers/GroovyJavaCompiler.java b/compilers/groovy/src/main/java/org/apache/commons/jci2/compilers/GroovyJavaCompiler.java
index e6d509f..0990538 100644
--- a/compilers/groovy/src/main/java/org/apache/commons/jci2/compilers/GroovyJavaCompiler.java
+++ b/compilers/groovy/src/main/java/org/apache/commons/jci2/compilers/GroovyJavaCompiler.java
@@ -117,7 +117,7 @@ public final class GroovyJavaCompiler extends AbstractJavaCompiler {
                 }
             }
         } catch (final CompilationFailedException e) {
-            throw new RuntimeException("no expected");
+            throw new IllegalArgumentException("no expected");
         }
 
         final CompilationProblem[] result = new CompilationProblem[problems.size()];
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 132c2a6..6563a01 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -69,6 +69,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory">
         EclipseJavaCompilerSettings.toNativeVersion(String) now throws IllegalArgumentException instead of RuntimeException.
       </action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">
+       GroovyJavaCompiler.compile() now throws IllegalArgumentException instead of RuntimeException.
+      </action>
       <!-- UPDATE -->
       <action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">
         Bump commons-io from 2.2 to 2.13.0 #11.