karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-3530] Prevent NPE in InstallKarsMojo
Date Fri, 12 Jun 2015 15:53:48 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-3.0.x 858be8c6b -> 4ae2a896f


[KARAF-3530] Prevent NPE in InstallKarsMojo


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/4ae2a896
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/4ae2a896
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/4ae2a896

Branch: refs/heads/karaf-3.0.x
Commit: 4ae2a896fa3b53fc4abd75dae26e0c1a1faab4d9
Parents: 858be8c
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Fri Jun 12 17:53:16 2015 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Fri Jun 12 17:53:16 2015 +0200

----------------------------------------------------------------------
 .../apache/karaf/tooling/features/InstallKarsMojo.java  | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/4ae2a896/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
----------------------------------------------------------------------
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
index be97abe..58a3702 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
@@ -194,23 +194,23 @@ public class InstallKarsMojo extends MojoSupport {
 
         // checking if all startup, installed, and boot features have been resolved
         getLog().info("Checking features resolution");
-        if (startupFeatures != null) {
+        if (features != null && startupFeatures != null) {
             for (String startupFeature : startupFeatures) {
-                if (!resolveFeature(features.keySet(), startupFeature)) {
+                if (startupFeature != null && !startupFeature.isEmpty() &&
!resolveFeature(features.keySet(), startupFeature)) {
                     throw new MojoFailureException("Startup feature " + startupFeature +
" is not resolved. Check that <dependencies/> provide the kar of features repository
providing this feature (with compile or runtime scope)");
                 }
             }
         }
-        if (bootFeatures != null) {
+        if (features != null && bootFeatures != null) {
             for (String bootFeature : bootFeatures) {
-                if (!resolveFeature(features.keySet(), bootFeature)) {
+                if (bootFeature != null && !bootFeature.isEmpty() && !resolveFeature(features.keySet(),
bootFeature)) {
                     throw new MojoFailureException("Boot feature " + bootFeature + " is not
resolved. Check that <dependencies/> provide the kar of features repository providing
this feature (with compile or runtime scope)");
                 }
             }
         }
-        if (installedFeatures != null) {
+        if (features != null && installedFeatures != null) {
             for (String installedFeature : installedFeatures) {
-                if (!resolveFeature(features.keySet(), installedFeature)) {
+                if (installedFeature != null && !installedFeature.isEmpty() &&
!resolveFeature(features.keySet(), installedFeature)) {
                     throw new MojoFailureException("Boot feature " + installedFeature + "
is not resolved. Check that <dependencies/> provide the kar of features repository providing
this feature (with compile or runtime scope)");
                 }
             }


Mime
View raw message