karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1494415 - /karaf/branches/karaf-2.3.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/ValidateFeaturesMojo.java
Date Wed, 19 Jun 2013 02:03:54 GMT
Author: ffang
Date: Wed Jun 19 02:03:54 2013
New Revision: 1494415

URL: http://svn.apache.org/r1494415
Log:
[KARAF-2363]Second feature validation result in an Exception

Modified:
    karaf/branches/karaf-2.3.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/ValidateFeaturesMojo.java

Modified: karaf/branches/karaf-2.3.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/ValidateFeaturesMojo.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/ValidateFeaturesMojo.java?rev=1494415&r1=1494414&r2=1494415&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/ValidateFeaturesMojo.java
(original)
+++ karaf/branches/karaf-2.3.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/ValidateFeaturesMojo.java
Wed Jun 19 02:03:54 2013
@@ -65,6 +65,8 @@ public class ValidateFeaturesMojo extend
 
     private static final String KARAF_CORE_STANDARD_FEATURE_URL = "mvn:org.apache.karaf.assemblies.features/standard/%s/xml/features";
     private static final String KARAF_CORE_ENTERPRISE_FEATURE_URL = "mvn:org.apache.karaf.assemblies.features/enterprise/%s/xml/features";
+    
+    private static boolean isCustomStreamURLHandlerSet;
 
     /**
      * The dependency tree builder to use.
@@ -190,7 +192,12 @@ public class ValidateFeaturesMojo extend
      */
     private void prepare() throws Exception {
         info("== Preparing for validation ==");
-        URL.setURLStreamHandlerFactory(new CustomBundleURLStreamHandlerFactory());
+        if (!isCustomStreamURLHandlerSet) {
+            //URL.setURLStreamHandlerFactory can be called at most once in a given Java Virtual
+            //Machine, so set a flag to avoid calling this method multiple times
+            URL.setURLStreamHandlerFactory(new CustomBundleURLStreamHandlerFactory());
+            isCustomStreamURLHandlerSet = true;
+        }
         info(" - getting list of system bundle exports");
         readSystemPackages();
         info(" - getting list of provided bundle exports");



Mime
View raw message