cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [02/48] cxf git commit: [CXF-6935] Better error message than NPE in Compiler.useJava6Compiler, patch from Gary Gregory applied with thanks
Date Wed, 29 Jun 2016 22:44:00 GMT
[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/53d3867c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/53d3867c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/53d3867c

Branch: refs/heads/master-jaxrs-2.1
Commit: 53d3867cd7135f8c34f8b570c9812c214c6a22fa
Parents: a51f6d9
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:19:43 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/53d3867c/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