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 18:43:39 UTC

[commons-jci] branch master updated: Jsr199JavaCompiler.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


The following commit(s) were added to refs/heads/master by this push:
     new fb98702  Jsr199JavaCompiler.compile() now throws IllegalStateException instead of RuntimeException when there is no compiler available
fb98702 is described below

commit fb98702a1ea9a5f8801d1c7aa9592e00b5e600f8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 23 14:43:35 2023 -0400

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

diff --git a/compilers/jsr199/src/main/java/org/apache/commons/jci2/compilers/Jsr199JavaCompiler.java b/compilers/jsr199/src/main/java/org/apache/commons/jci2/compilers/Jsr199JavaCompiler.java
index afdc6ad..6f2fd6a 100644
--- a/compilers/jsr199/src/main/java/org/apache/commons/jci2/compilers/Jsr199JavaCompiler.java
+++ b/compilers/jsr199/src/main/java/org/apache/commons/jci2/compilers/Jsr199JavaCompiler.java
@@ -212,7 +212,7 @@ public final class Jsr199JavaCompiler extends AbstractJavaCompiler {
         }
 
         if (compiler == null) {
-            throw new RuntimeException("No java compiler in class path");
+            throw new IllegalStateException("No java compiler in class path");
         }
 
         final JavaFileManager fileManager = new JciJavaFileManager(units, pStore);
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6563a01..0eb3949 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -72,6 +72,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory">
        GroovyJavaCompiler.compile() now throws IllegalArgumentException instead of RuntimeException.
       </action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">
+       Jsr199JavaCompiler.compile() now throws IllegalStateException instead of RuntimeException when there is no compiler available.
+      </action>
       <!-- UPDATE -->
       <action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">
         Bump commons-io from 2.2 to 2.13.0 #11.