FELIX-607 Use metatype localization attribute value as full base
path to bundle entries and still support the incorrect relative
resolution for backwards compatibility

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@668120 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java b/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java
index 72caf0f..39165b5 100644
--- a/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java
+++ b/metatype/src/main/java/org/apache/felix/metatype/DefaultMetaTypeProvider.java
@@ -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;
     }
 
 
diff --git a/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java b/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
index 7834c50..42dbb17 100644
--- a/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
+++ b/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
@@ -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;