Jean-Baptiste Onofré created KARAF-1387:
-------------------------------------------

             Summary: Warning to missing a feature repository name even when 
the name is defined
                 Key: KARAF-1387
                 URL: https://issues.apache.org/jira/browse/KARAF-1387
             Project: Karaf
          Issue Type: Bug
          Components: karaf-feature
    Affects Versions: 2.2.6
            Reporter: Jean-Baptiste Onofré
            Assignee: Jean-Baptiste Onofré
             Fix For: 2.2.7, 3.0.0


Karaf 2.2.6 always generates the following warning whether the
features repository has a name or not.

"Feature repository doesn't have a name. The name will be mandatory in
the next Karaf version."

This is because the name is checked before the repository is loaded.
Can some please apply the following patch?

===== 8< =====
Index: src/test/resources/org/apache/karaf/features/repo1.xml
===================================================================
--- src/test/resources/org/apache/karaf/features/repo1.xml      (revision 
1328930)
+++ src/test/resources/org/apache/karaf/features/repo1.xml      (working copy)
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<features>
+<features name="test">
     <repository>urn:r1</repository>
     <feature name="f1">
         <config name="c1">
Index: src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
===================================================================
--- src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java   
(revision
1328930)
+++ src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java   
(working
copy)
@@ -210,11 +210,11 @@
         validateRepository(uri);
         RepositoryImpl repo = null;
         repo = new RepositoryImpl(uri);
+        repositories.put(uri, repo);
+        repo.load();
         if (repo.getName() == null) {
             LOGGER.warn("Feature repository doesn't have a name. The
name will be mandatory in the next Karaf version.");
         }
-        repositories.put(uri, repo);
-        repo.load();
         callListeners(new RepositoryEvent(repo,
RepositoryEvent.EventType.RepositoryAdded, false));
         features = null;
         return repo;
===== 8< =====

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to