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-2104] Add exception with feature is not found
Date Fri, 19 Dec 2014 16:22:25 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-2.x 127849f43 -> 1e42fafb1


[KARAF-2104] Add exception with feature is not found


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

Branch: refs/heads/karaf-2.x
Commit: 1e42fafb17669eb129c8ce4f59f68d80e20f277a
Parents: 127849f
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Fri Dec 19 17:22:06 2014 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Fri Dec 19 17:22:06 2014 +0100

----------------------------------------------------------------------
 .../org/apache/karaf/features/internal/FeaturesServiceImpl.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/1e42fafb/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
index afa3c4f..4f96606 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
@@ -429,6 +429,9 @@ public class FeaturesServiceImpl implements FeaturesService {
     public void installFeature(String name, String version, EnumSet<Option> options)
throws Exception {
         ArrayList<Exception> exceptions = new ArrayList<Exception>();
         Feature[] features = getFeatures(name, version);
+        if (features.length < 1) {
+            throw new IllegalStateException("No feature matching " + name + "/" + version);
+        }
         for (Feature f : features) {
             try {
                 installFeature(f, options);


Mime
View raw message