cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6935] Better error message than NPE in Compiler.useJava6Compiler, patch from Gary Gregory applied with thanks
Date Wed, 08 Jun 2016 10:20:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 2f56d25ec -> 98d1eac7b


[CXF-6935] Better error message than NPE in Compiler.useJava6Compiler, patch from Gary Gregory
applied with thanks


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/98d1eac7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/98d1eac7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/98d1eac7

Branch: refs/heads/3.1.x-fixes
Commit: 98d1eac7b215dbafe697ad9ba14604d22cfc3bed
Parents: 2f56d25
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Jun 8 11:19:43 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Jun 8 11:20:31 2016 +0100

----------------------------------------------------------------------
 core/src/main/java/org/apache/cxf/common/util/Compiler.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/98d1eac7/core/src/main/java/org/apache/cxf/common/util/Compiler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/Compiler.java b/core/src/main/java/org/apache/cxf/common/util/Compiler.java
index e0247d8..8d9fcaa 100644
--- a/core/src/main/java/org/apache/cxf/common/util/Compiler.java
+++ b/core/src/main/java/org/apache/cxf/common/util/Compiler.java
@@ -184,6 +184,10 @@ public class Compiler {
 
     protected boolean useJava6Compiler(String[] files) {
         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+        if (compiler == null) {
+            throw new IllegalStateException(
+                "No compiler detected, make sure you are running on top of a JDK instead
of a JRE.");
+        }
         StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null,
null);
         Iterable<? extends JavaFileObject> fileList = fileManager.getJavaFileObjectsFromStrings(Arrays
             .asList(files));


Mime
View raw message