felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r668120 - in /felix/trunk/metatype/src/main/java/org/apache/felix/metatype: DefaultMetaTypeProvider.java internal/l10n/BundleResources.java
Date Mon, 16 Jun 2008 11:43:01 GMT
Author: fmeschbe
Date: Mon Jun 16 04:43:01 2008
New Revision: 668120

URL: http://svn.apache.org/viewvc?rev=668120&view=rev
Log:
FELIX-607 Use metatype localization attribute value as full base
path to bundle entries and still support the incorrect relative
resolution for backwards compatibility

Modified:
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java?rev=668120&r1=668119&r2=668120&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java
(original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java
Mon Jun 16 04:43:01 2008
@@ -51,11 +51,10 @@
 {
 
     private final Bundle bundle;
-
-    private String localePrefix;
+    private final String localePrefix;
+    
     private Map objectClassDefinitions;
     private Map designates;
-
     private Map locales;
 
 
@@ -83,19 +82,16 @@
             designates = Collections.unmodifiableMap( copy );
         }
 
-        localePrefix = metadata.getLocalePrefix();
-        if ( localePrefix == null )
+        String metaDataLocalePrefix = metadata.getLocalePrefix();
+        if ( metaDataLocalePrefix == null )
         {
-            localePrefix = ( String ) bundle.getHeaders().get( Constants.BUNDLE_LOCALIZATION
);
-            if ( localePrefix == null )
+            metaDataLocalePrefix = ( String ) bundle.getHeaders().get( Constants.BUNDLE_LOCALIZATION
);
+            if ( metaDataLocalePrefix == null )
             {
-                localePrefix = Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME;
+                metaDataLocalePrefix = Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME;
             }
         }
-        else
-        {
-            localePrefix = MetaTypeService.METATYPE_DOCUMENTS_LOCATION + "/" + localePrefix;
-        }
+        this.localePrefix = metaDataLocalePrefix;
     }
 
 

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java?rev=668120&r1=668119&r2=668120&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
(original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
Mon Jun 16 04:43:01 2008
@@ -32,13 +32,14 @@
 import java.util.StringTokenizer;
 
 import org.osgi.framework.Bundle;
+import org.osgi.service.metatype.MetaTypeService;
 
 
 /**
  * The <code>BundleResources</code> TODO
  *
  * @author fmeschbe
- * @version $Rev:$, $Date:$
+ * @version $Rev$, $Date$
  */
 public class BundleResources
 {
@@ -163,6 +164,13 @@
 
         Properties props = new Properties( parentProperties );
         URL resURL = bundle.getEntry( resourceName );
+        
+        // FELIX-607 backwards compatibility, support
+        if ( resURL == null )
+        {
+            resURL = bundle.getEntry( MetaTypeService.METATYPE_DOCUMENTS_LOCATION + "/" +
resourceName );
+        }
+        
         if ( resURL != null )
         {
             InputStream ins = null;



Mime
View raw message