geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1305389 - /geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java
Date Mon, 26 Mar 2012 15:10:31 GMT
Author: xuhaihong
Date: Mon Mar 26 15:10:30 2012
New Revision: 1305389

URL: http://svn.apache.org/viewvc?rev=1305389&view=rev
Log:
GERONIMO-6306 Keep the same behavior with hidden-classes between Geronimo 2.* and 3.*

Modified:
    geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java

Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java?rev=1305389&r1=1305388&r2=1305389&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java
(original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java
Mon Mar 26 15:10:30 2012
@@ -89,7 +89,8 @@ public class OSGiMetaDataBuilder {
     protected void processClassloadingRules(Environment environment) {
         //Process Hidden Class
         for (String hiddenClassPrefix : environment.getClassLoadingRules().getHiddenRule().getClassPrefixes())
{
-            environment.addImportPackage("!" + hiddenClassPrefix);
+            String inversedImportPackage = hiddenClassPrefix.endsWith("*") ? hiddenClassPrefix
: hiddenClassPrefix + "*";
+            environment.addImportPackage("!" + inversedImportPackage);
         }
         //Non-Overridable-Classes
         /*for (String hiddenClassPrefix : environment.getClassLoadingRules().getHiddenRule().getClassPrefixes())
{
@@ -110,8 +111,15 @@ public class OSGiMetaDataBuilder {
             }
             if (importPackageName.startsWith("!")) {
                 importPackageName = importPackageName.substring(1);
-                if (importPackageName.endsWith("*")) {
-                    hiddenImportPackageNamePrefixes.add(importPackageName.substring(0, importPackageName.length()
- 1));
+                boolean wildcardImportPakcageName = importPackageName.endsWith("*");
+                if (wildcardImportPakcageName) {
+                    importPackageName = importPackageName.substring(0, importPackageName.length()
- 1);
+                }
+                if (importPackageName.endsWith(".")) {
+                    importPackageName = importPackageName.substring(0, importPackageName.length()
- 1);
+                }
+                if (wildcardImportPakcageName) {
+                    hiddenImportPackageNamePrefixes.add(importPackageName);
                 } else {
                     hiddenImportPackageNames.add(importPackageName);
                 }



Mime
View raw message