karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [karaf] 01/02: [KARAF-5547] Blueprint namespace handlers cause warning to be printed
Date Mon, 18 Dec 2017 09:36:14 GMT
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git

commit be7856896c5df8b6975e0d78edbf71424277b1b2
Author: Guillaume Nodet <gnodet@gmail.com>
AuthorDate: Mon Dec 18 09:16:56 2017 +0100

    [KARAF-5547] Blueprint namespace handlers cause warning to be printed
---
 .../karaf/jaas/blueprint/config/impl/NamespaceHandler.java    | 11 +++++++----
 .../karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java |  9 +++++++--
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java
b/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java
index 1352bbc..4f21d99 100644
--- a/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java
+++ b/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java
@@ -48,10 +48,13 @@ import org.w3c.dom.NodeList;
 public class NamespaceHandler implements org.apache.aries.blueprint.NamespaceHandler {
 
     public URL getSchemaLocation(String namespace) {
-        if ("http://karaf.apache.org/xmlns/jaas/v1.0.0".equals(namespace)) {
-            return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.0.0.xsd");
-        } else {
-            return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.1.0.xsd");
+        switch (namespace) {
+            case "http://karaf.apache.org/xmlns/jaas/v1.0.0":
+                return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.0.0.xsd");
+            case "http://karaf.apache.org/xmlns/jaas/v1.1.0":
+                return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.1.0.xsd");
+            default:
+                return null;
         }
     }
 
diff --git a/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java
b/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java
index 9b4fdbb..894d358 100644
--- a/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java
+++ b/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java
@@ -52,8 +52,13 @@ public class NamespaceHandler implements org.apache.aries.blueprint.NamespaceHan
 
     private int idCounter;
 
-    public URL getSchemaLocation(String s) {
-        return getClass().getResource("/org/apache/karaf/jaas/blueprint/jasypt/handler/karaf-jasypt-1.0.0.xsd");
+    public URL getSchemaLocation(String namespace) {
+        switch (namespace) {
+            case "http://karaf.apache.org/xmlns/jasypt/v1.0.0":
+                return getClass().getResource("/org/apache/karaf/jaas/blueprint/jasypt/handler/karaf-jasypt-1.0.0.xsd");
+            default:
+                return null;
+        }
     }
 
     public Set<Class> getManagedClasses() {

-- 
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <commits@karaf.apache.org>.

Mime
View raw message