aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahrw...@apache.org
Subject svn commit: r1131077 - in /aries/trunk: application/application-deployment-management/src/main/java/org/apache/aries/application/deployment/management/impl/ application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/ appli...
Date Fri, 03 Jun 2011 15:40:25 GMT
Author: mahrwald
Date: Fri Jun  3 15:40:25 2011
New Revision: 1131077

URL: http://svn.apache.org/viewvc?rev=1131077&view=rev
Log:
ARIES-582: Clean up ManifestHeaderProcessor API a bit

Modified:
    aries/trunk/application/application-deployment-management/src/main/java/org/apache/aries/application/deployment/management/impl/DeploymentManifestManagerImpl.java
    aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/IsolatedRuntimeTest.java
    aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java
    aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ExportedBundleImpl.java
    aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceImpl.java
    aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/utils/impl/ModellingHelperImpl.java
    aries/trunk/application/application-modeller/src/test/java/org/apache/aries/application/modelling/utils/DeployedBundlesTest.java
    aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/OBRAriesResolver.java
    aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/SharedFrameworkPreResolveHook.java
    aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/utils/EquinoxFrameworkUtils.java
    aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ApplicationMetadataImpl.java
    aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ContentImpl.java
    aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/DeploymentContentImpl.java
    aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/management/SimpleBundleInfo.java
    aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ContentFactory.java
    aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/ApplicationMetadataImplTest.java
    aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/DeploymentContentImplTest.java
    aries/trunk/util/src/main/java/org/apache/aries/util/manifest/BundleManifest.java
    aries/trunk/util/src/main/java/org/apache/aries/util/manifest/ManifestHeaderProcessor.java
    aries/trunk/util/src/test/java/org/apache/aries/util/manifest/ManifestHeaderProcessorTest.java

Modified: aries/trunk/application/application-deployment-management/src/main/java/org/apache/aries/application/deployment/management/impl/DeploymentManifestManagerImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-deployment-management/src/main/java/org/apache/aries/application/deployment/management/impl/DeploymentManifestManagerImpl.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-deployment-management/src/main/java/org/apache/aries/application/deployment/management/impl/DeploymentManifestManagerImpl.java (original)
+++ aries/trunk/application/application-deployment-management/src/main/java/org/apache/aries/application/deployment/management/impl/DeploymentManifestManagerImpl.java Fri Jun  3 15:40:25 2011
@@ -68,7 +68,6 @@ import org.apache.aries.application.util
 import org.apache.aries.util.filesystem.FileSystem;
 import org.apache.aries.util.filesystem.IOUtils;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Filter;
 import org.osgi.service.blueprint.container.ServiceUnavailableException;
@@ -584,10 +583,10 @@ public class DeploymentManifestManagerIm
    */
   private boolean providesPackage(ModelledResource bundle, String importPackages)
   {
-    Map<String, NameValueMap<String, String>> imports = ManifestHeaderProcessor.parseImportString(importPackages);
+    Map<String, Map<String, String>> imports = ManifestHeaderProcessor.parseImportString(importPackages);
     
     try {
-      for (Map.Entry<String, NameValueMap<String,String>> e : imports.entrySet()) {
+      for (Map.Entry<String, Map<String,String>> e : imports.entrySet()) {
         ImportedPackage importPackage = modellingManager.getImportedPackage(e.getKey(), e.getValue());
         
         for (ExportedPackage export : bundle.getExportedPackages()) {

Modified: aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/IsolatedRuntimeTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/IsolatedRuntimeTest.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/IsolatedRuntimeTest.java (original)
+++ aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/IsolatedRuntimeTest.java Fri Jun  3 15:40:25 2011
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertNul
 import static org.ops4j.pax.exam.CoreOptions.equinox;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
 import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
 
 import java.io.File;
@@ -208,11 +207,13 @@ public class IsolatedRuntimeTest extends
         getOsgiService(ModellingManager.class));
 
     AriesApplication newApp = manager.resolve(app, new ResolveConstraint() {
-      public String getBundleName() {
+      @Override
+	public String getBundleName() {
         return "org.apache.aries.isolated.sample";
       }
 
-      public VersionRange getVersionRange() {
+      @Override
+	public VersionRange getVersionRange() {
         return ManifestHeaderProcessor.parseVersionRange("[2.0.0,2.0.0]", true);
       }
     });

Modified: aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java (original)
+++ aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java Fri Jun  3 15:40:25 2011
@@ -30,8 +30,10 @@ import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -54,8 +56,6 @@ import org.apache.aries.unittest.fixture
 import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
 import org.apache.aries.util.filesystem.FileSystem;
 import org.apache.aries.util.filesystem.IDirectory;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.apache.felix.bundlerepository.Repository;
 import org.apache.felix.bundlerepository.RepositoryAdmin;
 import org.junit.After;
@@ -312,7 +312,7 @@ public class OBRResolverAdvancedTest ext
     }
     assertTrue("Bundle " + USE_BUNDLE_BY_REFERENCE + " not found.", bundleSymbolicNames.contains(USE_BUNDLE_BY_REFERENCE));
     Collection<String> packages = new ArrayList<String>();
-    NameValueMap<String, String> maps = new NameValueMap<String, String>();
+    Map<String, String> maps = new HashMap<String, String>();
     maps.put("version", "0.0.0");
     maps.put("bundle-symbolic-name", "use.bundle.by.reference");
     maps.put("bundle-version", "[1.0.0,1.0.0]");

Modified: aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ExportedBundleImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ExportedBundleImpl.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ExportedBundleImpl.java (original)
+++ aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ExportedBundleImpl.java Fri Jun  3 15:40:25 2011
@@ -32,7 +32,6 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.modelling.internal.MessageUtil;
 import org.apache.aries.application.modelling.utils.impl.ModellingHelperImpl;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class ExportedBundleImpl extends 
     logger.debug(LOG_ENTRY, "ExportedBundleImpl", attrs);
     String symbolicName = attrs.getValue(Constants.BUNDLE_SYMBOLICNAME);
     
-    Map<String,NameValueMap<String, String>> map = ManifestHeaderProcessor.parseImportString(symbolicName);
+    Map<String,Map<String, String>> map = ManifestHeaderProcessor.parseImportString(symbolicName);
     
     //This should have one entry, which is keyed on the symbolicName
     
@@ -67,7 +66,7 @@ public class ExportedBundleImpl extends 
       throw iax;
     }
     
-    Map.Entry<String, NameValueMap<String, String>> entry =  map.entrySet().iterator().next();
+    Map.Entry<String, Map<String, String>> entry =  map.entrySet().iterator().next();
     
     symbolicName = entry.getKey();
     
@@ -121,26 +120,30 @@ public class ExportedBundleImpl extends 
   }
 
 
-  public Map<String, Object> getAttributes() {
+  @Override
+public Map<String, Object> getAttributes() {
     logger.debug(LOG_ENTRY, "getAttributes");
     logger.debug(LOG_EXIT, "getAttributes", new Object[]{_attributes});
     return Collections.unmodifiableMap(_attributes);
   }
   
 
-  public String toString() {
+  @Override
+public String toString() {
     return  _attributes.toString();
   }
 
  
-  public ImportedBundle getFragmentHost() {
+  @Override
+public ImportedBundle getFragmentHost() {
     logger.debug(LOG_ENTRY, "getFragmentHost");
     logger.debug(LOG_EXIT, "getFragmentHost", new Object[]{_fragHost});
     return _fragHost;
   }
 
 
-  public boolean isFragment() {
+  @Override
+public boolean isFragment() {
     logger.debug(LOG_ENTRY, "isFragment");
     boolean result = _fragHost != null;
     logger.debug(LOG_EXIT, "isFragment", new Object[]{result});

Modified: aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceImpl.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceImpl.java (original)
+++ aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceImpl.java Fri Jun  3 15:40:25 2011
@@ -51,7 +51,6 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.modelling.ModellingConstants;
 import org.apache.aries.application.modelling.ResourceType;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValuePair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -153,11 +152,11 @@ public class ModelledResourceImpl implem
     _exportedPackages = new ArrayList<ExportedPackage>();
     String packageExports = bundleAttributes.getValue(EXPORT_PACKAGE);
     if (packageExports != null) {
-      List<NameValuePair<String, NameValueMap<String, String>>> exportedPackages = ManifestHeaderProcessor
+      List<NameValuePair> exportedPackages = ManifestHeaderProcessor
         .parseExportString(packageExports);
-      for (NameValuePair<String, NameValueMap<String, String>> exportedPackage : exportedPackages) {
+      for (NameValuePair exportedPackage : exportedPackages) {
         _exportedPackages.add(new ExportedPackageImpl(this, exportedPackage.getName(), 
-            new HashMap<String, Object>(exportedPackage.getValue())));
+            new HashMap<String, Object>(exportedPackage.getAttributes())));
     
       }
     }
@@ -165,9 +164,9 @@ public class ModelledResourceImpl implem
     _importedPackages = new ArrayList<ImportedPackage>();
     String packageImports = bundleAttributes.getValue(IMPORT_PACKAGE);
     if (packageImports != null) {
-      Map<String, NameValueMap<String, String>> importedPackages = ManifestHeaderProcessor
+      Map<String, Map<String, String>> importedPackages = ManifestHeaderProcessor
           .parseImportString(packageImports);
-      for (Map.Entry<String, NameValueMap<String, String>> importedPackage : importedPackages.entrySet()) {
+      for (Map.Entry<String, Map<String, String>> importedPackage : importedPackages.entrySet()) {
         Map<String, String> atts = importedPackage.getValue();
         _importedPackages.add(new ImportedPackageImpl(importedPackage.getKey(), atts));
       }
@@ -181,10 +180,10 @@ public class ModelledResourceImpl implem
       serviceExports = bundleAttributes.getValue(EXPORT_SERVICE);
     } 
     if (serviceExports != null) {
-      List<NameValuePair<String, NameValueMap<String, String>>> expServices = ManifestHeaderProcessor
+      List<NameValuePair> expServices = ManifestHeaderProcessor
           .parseExportString(serviceExports);
-      for (NameValuePair<String, NameValueMap<String, String>> exportedService : expServices) {
-        _exportedServices.add(new ExportedServiceImpl(exportedService.getName(), exportedService.getValue()));
+      for (NameValuePair exportedService : expServices) {
+        _exportedServices.add(new ExportedServiceImpl(exportedService.getName(), exportedService.getAttributes()));
       }
     }
   
@@ -193,9 +192,9 @@ public class ModelledResourceImpl implem
       serviceImports = bundleAttributes.getValue(IMPORT_SERVICE);
     } 
     if (serviceImports != null) {
-      Map<String, NameValueMap<String, String>> svcImports = ManifestHeaderProcessor
+      Map<String, Map<String, String>> svcImports = ManifestHeaderProcessor
           .parseImportString(serviceImports);
-      for (Map.Entry<String, NameValueMap<String, String>> importedService : svcImports.entrySet()) {
+      for (Map.Entry<String, Map<String, String>> importedService : svcImports.entrySet()) {
         _importedServices.add(new ImportedServiceImpl(importedService.getKey(), importedService.getValue()));
       }
     }
@@ -205,9 +204,9 @@ public class ModelledResourceImpl implem
     if (_resourceType == ResourceType.BUNDLE) { 
       String requireBundleHeader = bundleAttributes.getValue(REQUIRE_BUNDLE);
       if (requireBundleHeader != null) {
-        Map<String, NameValueMap<String, String>> requiredBundles = ManifestHeaderProcessor
+        Map<String, Map<String, String>> requiredBundles = ManifestHeaderProcessor
             .parseImportString(requireBundleHeader);
-        for (Map.Entry<String, NameValueMap<String, String>> bundle : requiredBundles.entrySet()) {
+        for (Map.Entry<String, Map<String, String>> bundle : requiredBundles.entrySet()) {
           String type = bundle.getKey();
           Map<String, String> attribs = bundle.getValue();
           // We may parse a manifest with a header like Require-Bundle: bundle.a;bundle-version=3.0.0
@@ -225,9 +224,9 @@ public class ModelledResourceImpl implem
     
       String dynamicImports = bundleAttributes.getValue(DYNAMICIMPORT_PACKAGE);
       if (dynamicImports != null) {
-        Map<String, NameValueMap<String, String>> dynamicImportPackages = ManifestHeaderProcessor
+        Map<String, Map<String, String>> dynamicImportPackages = ManifestHeaderProcessor
             .parseImportString(dynamicImports);
-        for (Map.Entry<String, NameValueMap<String, String>> dynImportPkg : dynamicImportPackages.entrySet()) {
+        for (Map.Entry<String, Map<String, String>> dynImportPkg : dynamicImportPackages.entrySet()) {
           if (dynImportPkg.getKey().indexOf("*") == -1) {
             dynImportPkg.getValue().put(RESOLUTION_DIRECTIVE + ":", RESOLUTION_OPTIONAL);
             _importedPackages.add(new ImportedPackageImpl(dynImportPkg.getKey(), dynImportPkg.getValue()));
@@ -239,21 +238,24 @@ public class ModelledResourceImpl implem
   }
 
 
-  public String getLocation() {
+  @Override
+public String getLocation() {
     logger.debug(LOG_ENTRY, "getLocation");
     logger.debug(LOG_EXIT, "getLocation", _fileURI);
     return _fileURI;
   }
 
 
-  public ExportedBundle getExportedBundle() {
+  @Override
+public ExportedBundle getExportedBundle() {
     logger.debug(LOG_ENTRY, "getExportedBundle");
     logger.debug(LOG_EXIT, "getExportedBundle",  _exportedBundle);
     return _exportedBundle;
   }
 
 
-  public Collection<ExportedPackage> getExportedPackages() {
+  @Override
+public Collection<ExportedPackage> getExportedPackages() {
     logger.debug(LOG_ENTRY, "getExportedPackages");
     logger.debug(LOG_EXIT, "getExportedPackages",  _exportedPackages);
     return Collections.unmodifiableCollection(_exportedPackages);
@@ -261,13 +263,15 @@ public class ModelledResourceImpl implem
   
 
 
-  public Collection<ImportedPackage> getImportedPackages() {
+  @Override
+public Collection<ImportedPackage> getImportedPackages() {
     logger.debug(LOG_ENTRY, "getImportedPackages");
     logger.debug(LOG_EXIT, "getImportedPackages",  _importedPackages);
     return Collections.unmodifiableCollection(_importedPackages);
   }
 
-  public Collection<ExportedService> getExportedServices() {
+  @Override
+public Collection<ExportedService> getExportedServices() {
     logger.debug(LOG_ENTRY, "getExportedServices");
     logger.debug(LOG_EXIT, "getExportedServices",  _exportedServices);
     return Collections.unmodifiableCollection(_exportedServices);
@@ -275,14 +279,16 @@ public class ModelledResourceImpl implem
 
 
 
-  public Collection<ImportedService> getImportedServices() {
+  @Override
+public Collection<ImportedService> getImportedServices() {
     logger.debug(LOG_ENTRY, "getImportedServices");
     logger.debug(LOG_EXIT, "getImportedServices",  _exportedServices);
     return Collections.unmodifiableCollection(_importedServices);
   }
 
 
-  public String getSymbolicName() {
+  @Override
+public String getSymbolicName() {
     logger.debug(LOG_ENTRY, "getSymbolicName");
     String result = _exportedBundle.getSymbolicName();
     logger.debug(LOG_EXIT, "getSymbolicName",  result);
@@ -290,7 +296,8 @@ public class ModelledResourceImpl implem
   }
   
 
-  public String getVersion() {
+  @Override
+public String getVersion() {
     logger.debug(LOG_ENTRY, "getVersion");
     String result = _exportedBundle.getVersion();
     logger.debug(LOG_EXIT, "getVersion",  result);
@@ -298,7 +305,8 @@ public class ModelledResourceImpl implem
   }
 
 
-  public String toDeploymentString() {
+  @Override
+public String toDeploymentString() {
     logger.debug(LOG_ENTRY, "toDeploymentString");
     String result = _exportedBundle.toDeploymentString();
     logger.debug(LOG_EXIT, "toDeploymentString",  result);
@@ -306,7 +314,8 @@ public class ModelledResourceImpl implem
   }
 
 
-  public ResourceType getType() {
+  @Override
+public ResourceType getType() {
     logger.debug(LOG_ENTRY, "getType");
     logger.debug(LOG_EXIT, "getType",  ResourceType.BUNDLE);
     return _resourceType;
@@ -318,14 +327,16 @@ public class ModelledResourceImpl implem
   }
 
 
-  public Collection<ImportedBundle> getRequiredBundles() {
+  @Override
+public Collection<ImportedBundle> getRequiredBundles() {
     logger.debug(LOG_ENTRY, "getRequiredBundles");
     logger.debug(LOG_EXIT, "getRequiredBundles",  _requiredBundles);
     return Collections.unmodifiableCollection(_requiredBundles);
   }
 
 
-  public ImportedBundle getFragmentHost() {
+  @Override
+public ImportedBundle getFragmentHost() {
     logger.debug(LOG_ENTRY, "getFragmentHost");
     ImportedBundle result = _exportedBundle.getFragmentHost();
     logger.debug(LOG_EXIT, "getFragmentHost",  result);
@@ -333,7 +344,8 @@ public class ModelledResourceImpl implem
   }
 
 
-  public boolean isFragment() {
+  @Override
+public boolean isFragment() {
     logger.debug(LOG_ENTRY, "isFragment");
     boolean result = _exportedBundle.isFragment();
     logger.debug(LOG_EXIT, "isFragment",  result);

Modified: aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/utils/impl/ModellingHelperImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/utils/impl/ModellingHelperImpl.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/utils/impl/ModellingHelperImpl.java (original)
+++ aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/utils/impl/ModellingHelperImpl.java Fri Jun  3 15:40:25 2011
@@ -43,7 +43,6 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.modelling.utils.ModellingHelper;
 import org.apache.aries.util.VersionRange;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.osgi.framework.Constants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -115,7 +114,7 @@ public class ModellingHelperImpl impleme
       
       return null;
     }
-    Map<String, NameValueMap<String, String>> parsedFragHost = ManifestHeaderProcessor.parseImportString(fragmentHostHeader);
+    Map<String, Map<String, String>> parsedFragHost = ManifestHeaderProcessor.parseImportString(fragmentHostHeader);
     if(parsedFragHost.size() != 1)
       throw new InvalidAttributeException(MessageUtil.getMessage("APPUTILS0001W",
           new Object[] {fragmentHostHeader}, 

Modified: aries/trunk/application/application-modeller/src/test/java/org/apache/aries/application/modelling/utils/DeployedBundlesTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-modeller/src/test/java/org/apache/aries/application/modelling/utils/DeployedBundlesTest.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-modeller/src/test/java/org/apache/aries/application/modelling/utils/DeployedBundlesTest.java (original)
+++ aries/trunk/application/application-modeller/src/test/java/org/apache/aries/application/modelling/utils/DeployedBundlesTest.java Fri Jun  3 15:40:25 2011
@@ -43,7 +43,6 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.modelling.impl.ModelledResourceImpl;
 import org.apache.aries.application.modelling.utils.impl.ModellingHelperImpl;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValuePair;
 import org.junit.Assert;
 import org.junit.Test;
@@ -145,8 +144,8 @@ public final class DeployedBundlesTest
    */
   private static boolean isEqual(String actual, String expected)
   {
-    Map<NameValuePair<String, NameValueMap<String, String>>, Integer> actualEntries = parseEntries(actual);
-    Map<NameValuePair<String, NameValueMap<String, String>>, Integer> expectedEntries = parseEntries(expected);
+    Map<NameValuePair, Integer> actualEntries = parseEntries(actual);
+    Map<NameValuePair, Integer> expectedEntries = parseEntries(expected);
     return actualEntries.equals(expectedEntries);
   }
 
@@ -158,10 +157,10 @@ public final class DeployedBundlesTest
    * @param entries a manifest header entry.
    * @return a set of parsed entries.
    */
-  private static Map<NameValuePair<String, NameValueMap<String, String>>, Integer> parseEntries(String entries)
+  private static Map<NameValuePair, Integer> parseEntries(String entries)
   {
-    Map<NameValuePair<String, NameValueMap<String, String>>, Integer> result = new HashMap<NameValuePair<String, NameValueMap<String, String>>, Integer>();
-    for (NameValuePair<String, NameValueMap<String, String>> entry : ManifestHeaderProcessor.parseExportString(entries))
+    Map<NameValuePair, Integer> result = new HashMap<NameValuePair, Integer>();
+    for (NameValuePair entry : ManifestHeaderProcessor.parseExportString(entries))
     {
       Integer count = result.get(entry);
       if (count != null)

Modified: aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/OBRAriesResolver.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/OBRAriesResolver.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/OBRAriesResolver.java (original)
+++ aries/trunk/application/application-obr-resolver/src/main/java/org/apache/aries/application/resolver/obr/OBRAriesResolver.java Fri Jun  3 15:40:25 2011
@@ -35,7 +35,6 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -65,7 +64,6 @@ import org.apache.aries.application.util
 import org.apache.aries.util.VersionRange;
 import org.apache.aries.util.filesystem.IOUtils;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.apache.felix.bundlerepository.Capability;
 import org.apache.felix.bundlerepository.DataModelHelper;
 import org.apache.felix.bundlerepository.Reason;
@@ -164,7 +162,7 @@ public class OBRAriesResolver implements
       } else {
 
         for (Resource r : requiredResources) {
-          NameValueMap<String, String> attribs = new NameValueMap<String, String>();
+          Map<String, String> attribs = new HashMap<String, String>();
           attribs.put(Constants.VERSION_ATTRIBUTE, "[" + r.getVersion() + ',' + r.getVersion()
               + "]");
           ModelledResource modelledResourceForThisMatch = null; 

Modified: aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/SharedFrameworkPreResolveHook.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/SharedFrameworkPreResolveHook.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/SharedFrameworkPreResolveHook.java (original)
+++ aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/SharedFrameworkPreResolveHook.java Fri Jun  3 15:40:25 2011
@@ -40,9 +40,7 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.utils.manifest.ContentFactory;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
 import org.apache.aries.util.manifest.ManifestProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
 
@@ -53,72 +51,83 @@ public class SharedFrameworkPreResolveHo
   
   private static final class BundleInfoImpl implements BundleInfo
   {
-    private Bundle compositeBundle;
+    private final Bundle compositeBundle;
     
     public BundleInfoImpl(Bundle bundle) {
       compositeBundle = bundle;
     }
     
-    public String getSymbolicName()
+    @Override
+	public String getSymbolicName()
     {
       return compositeBundle.getSymbolicName();
     }
 
-    public Map<String, String> getBundleDirectives()
+    @Override
+	public Map<String, String> getBundleDirectives()
     {
       return Collections.emptyMap();
     }
 
-    public Map<String, String> getBundleAttributes()
+    @Override
+	public Map<String, String> getBundleAttributes()
     {
       return Collections.emptyMap();
     }
 
-    public Version getVersion()
+    @Override
+	public Version getVersion()
     {
       return compositeBundle.getVersion();
     }
 
-    public String getLocation()
+    @Override
+	public String getLocation()
     {
       return compositeBundle.getLocation();
     }
 
-    public Set<Content> getImportPackage()
+    @Override
+	public Set<Content> getImportPackage()
     {
       return Collections.emptySet();
     }
 
-    public Set<Content> getRequireBundle()
+    @Override
+	public Set<Content> getRequireBundle()
     {
       return Collections.emptySet();
     }
 
-    public Set<Content> getExportPackage()
+    @Override
+	public Set<Content> getExportPackage()
     {
       String imports = (String) compositeBundle.getHeaders().get(Constants.IMPORT_PACKAGE);
       
       Set<Content> exports = new HashSet<Content>();
       
-      Map<String, NameValueMap<String, String>> parsedImports = ManifestHeaderProcessor.parseImportString(imports);
-      for (Map.Entry<String, NameValueMap<String, String>> anImport : parsedImports.entrySet()) {
+      Map<String, Map<String, String>> parsedImports = ManifestHeaderProcessor.parseImportString(imports);
+      for (Map.Entry<String, Map<String, String>> anImport : parsedImports.entrySet()) {
         exports.add(ContentFactory.parseContent(anImport.getKey(), anImport.getValue()));
       }
       
       return exports;
     }
 
-    public Set<Content> getImportService()
+    @Override
+	public Set<Content> getImportService()
     {
       return Collections.emptySet();
     }
 
-    public Set<Content> getExportService()
+    @Override
+	public Set<Content> getExportService()
     {
       return Collections.emptySet();
     }
 
-    public Map<String, String> getHeaders()
+    @Override
+	public Map<String, String> getHeaders()
     {
       Map<String, String> result = new HashMap<String, String>();
       @SuppressWarnings("unchecked")
@@ -138,14 +147,16 @@ public class SharedFrameworkPreResolveHo
       return result;
     }
 
-    public Attributes getRawAttributes()
+    @Override
+	public Attributes getRawAttributes()
     {
       return ManifestProcessor.mapToManifest(getHeaders()).getMainAttributes();
     }
     
   }
   
-  public void collectFakeResources(Collection<ModelledResource> resources)
+  @Override
+public void collectFakeResources(Collection<ModelledResource> resources)
   {
     Bundle b = fwMgr.getSharedBundleFramework().getIsolatedBundleContext().getBundle(1);
     BundleInfo info = new BundleInfoImpl(b);

Modified: aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/utils/EquinoxFrameworkUtils.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/utils/EquinoxFrameworkUtils.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/utils/EquinoxFrameworkUtils.java (original)
+++ aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/utils/EquinoxFrameworkUtils.java Fri Jun  3 15:40:25 2011
@@ -29,7 +29,6 @@ import org.apache.aries.application.Cont
 import org.apache.aries.application.utils.manifest.ContentFactory;
 import org.apache.aries.util.VersionRange;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValuePair;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -47,9 +46,9 @@ public class EquinoxFrameworkUtils
     if (sysBundle != null && sysBundle.getHeaders() != null) {
       String exportString = (String) sysBundle.getHeaders().get(Constants.EXPORT_PACKAGE);
       if (exportString != null) {
-        for (NameValuePair<String, NameValueMap<String, String>> nvp : ManifestHeaderProcessor
+        for (NameValuePair nvp : ManifestHeaderProcessor
             .parseExportString(exportString))
-          exports.add(ContentFactory.parseContent(nvp.getName(), nvp.getValue()));
+          exports.add(ContentFactory.parseContent(nvp.getName(), nvp.getAttributes()));
       }
     }
     return Collections.unmodifiableSet(exports);
@@ -61,9 +60,9 @@ public class EquinoxFrameworkUtils
     
       String exportString = context.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
       if (exportString != null) {
-        for (NameValuePair<String, NameValueMap<String, String>> nvp : ManifestHeaderProcessor
+        for (NameValuePair nvp : ManifestHeaderProcessor
             .parseExportString(exportString))
-          extraPkgs.add(ContentFactory.parseContent(nvp.getName(), nvp.getValue()));
+          extraPkgs.add(ContentFactory.parseContent(nvp.getName(), nvp.getAttributes()));
       }
     
     return Collections.unmodifiableSet(extraPkgs);
@@ -123,7 +122,7 @@ public class EquinoxFrameworkUtils
 
     // Let's always set javax.transaction as system extra packages because of the split package. 
     // It is reasonable to do so because we always flow userTransaction service into child framework anyway.
-    NameValueMap<String, String> map = new NameValueMap<String, String>();
+    Map<String, String> map = new HashMap<String, String>();
     map.put(EquinoxFrameworkConstants.TRANSACTION_BUNDLE, EquinoxFrameworkConstants.TRANSACTION_BUNDLE_VERSION);
     Map<String, Map<String, String>> resultMap = new HashMap<String, Map<String, String>>();
     resultMap.put(EquinoxFrameworkConstants.TRANSACTION_BUNDLE, map);

Modified: aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ApplicationMetadataImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ApplicationMetadataImpl.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ApplicationMetadataImpl.java (original)
+++ aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ApplicationMetadataImpl.java Fri Jun  3 15:40:25 2011
@@ -38,7 +38,6 @@ import org.apache.aries.application.Cont
 import org.apache.aries.application.ServiceDeclaration;
 import org.apache.aries.application.utils.AppConstants;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.Version;
 import org.slf4j.Logger;
@@ -55,11 +54,11 @@ public final class ApplicationMetadataIm
   private Version appVersion;
   private String appName;
   private String appScope;
-  private List<Content> appContents;
-  private List<ServiceDeclaration> importServices;
-  private List<ServiceDeclaration> exportServices;
-  private Manifest manifest;
-  private List<Content> useBundle;
+  private final List<Content> appContents;
+  private final List<ServiceDeclaration> importServices;
+  private final List<ServiceDeclaration> exportServices;
+  private final Manifest manifest;
+  private final List<Content> useBundle;
   /**
    * create the applicationMetadata from appManifest
    * @param appManifest   the Application.mf manifest
@@ -99,15 +98,15 @@ public final class ApplicationMetadataIm
     // configure appContents
  // use parseImportString as we don't allow appContents to be duplicate
     String applicationContents = appMap.get(AppConstants.APPLICATION_CONTENT);
-    Map<String, NameValueMap<String, String>> appContentsMap = ManifestHeaderProcessor.parseImportString(applicationContents);
-    for (Map.Entry<String, NameValueMap<String, String>> e : appContentsMap.entrySet()) {
+    Map<String, Map<String, String>> appContentsMap = ManifestHeaderProcessor.parseImportString(applicationContents);
+    for (Map.Entry<String, Map<String, String>> e : appContentsMap.entrySet()) {
       this.appContents.add(new ContentImpl(e.getKey(), e.getValue()));
     }
    
     String useBundleStr = appMap.get(AppConstants.APPLICATION_USE_BUNDLE);
     if (useBundleStr != null) {
-      Map<String, NameValueMap<String, String>> useBundleMap = ManifestHeaderProcessor.parseImportString(useBundleStr);
-    for (Map.Entry<String, NameValueMap<String, String>> e : useBundleMap.entrySet()) {
+      Map<String, Map<String, String>> useBundleMap = ManifestHeaderProcessor.parseImportString(useBundleStr);
+    for (Map.Entry<String, Map<String, String>> e : useBundleMap.entrySet()) {
         this.useBundle.add(new ContentImpl(e.getKey(), e.getValue()));
       }
     }
@@ -163,42 +162,50 @@ public final class ApplicationMetadataIm
     return props;
   }  
     
-  public List<Content> getApplicationContents()
+  @Override
+public List<Content> getApplicationContents()
   {
     return Collections.unmodifiableList(this.appContents);
   }
 
-  public List<ServiceDeclaration> getApplicationExportServices()
+  @Override
+public List<ServiceDeclaration> getApplicationExportServices()
   {
     return Collections.unmodifiableList(this.exportServices);
   }
 
-  public List<ServiceDeclaration> getApplicationImportServices()
+  @Override
+public List<ServiceDeclaration> getApplicationImportServices()
   {
     return Collections.unmodifiableList(this.importServices);
   }
 
-  public String getApplicationSymbolicName()
+  @Override
+public String getApplicationSymbolicName()
   {
     return this.appSymbolicName;
   }
 
-  public Version getApplicationVersion()
+  @Override
+public Version getApplicationVersion()
   {
     return this.appVersion;
   }
 
-  public String getApplicationName() 
+  @Override
+public String getApplicationName() 
   {
     return this.appName;
   }
   
-  public String getApplicationScope() 
+  @Override
+public String getApplicationScope() 
   {
     return appScope;
   }
   
-  public boolean equals(Object other)
+  @Override
+public boolean equals(Object other)
   {
     if (other == this) return true;
     if (other == null) return false;
@@ -209,18 +216,21 @@ public final class ApplicationMetadataIm
     return false;
   }
   
-  public int hashCode()
+  @Override
+public int hashCode()
   {
     return appScope.hashCode();
   }
 
-  public void store(File f) throws IOException {
+  @Override
+public void store(File f) throws IOException {
     FileOutputStream fos = new FileOutputStream (f);
     store(fos);
     fos.close();
   }
 
-  public void store(OutputStream out) throws IOException {
+  @Override
+public void store(OutputStream out) throws IOException {
     if (manifest != null) {
       Attributes att = manifest.getMainAttributes();
       if ((att.getValue(Attributes.Name.MANIFEST_VERSION.toString())) == null) {
@@ -230,7 +240,8 @@ public final class ApplicationMetadataIm
     }
   }
 
-  public Collection<Content> getUseBundles()
+  @Override
+public Collection<Content> getUseBundles()
   {
     return this.useBundle;
   }

Modified: aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ContentImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ContentImpl.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ContentImpl.java (original)
+++ aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/ContentImpl.java Fri Jun  3 15:40:25 2011
@@ -26,7 +26,6 @@ import org.apache.aries.application.Cont
 import org.apache.aries.application.utils.internal.MessageUtil;
 import org.apache.aries.util.VersionRange;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
 
@@ -40,18 +39,18 @@ public final class ContentImpl implement
   private String contentName;
   protected Map<String, String> attributes;
   private Map<String, String> directives;
-  private NameValueMap<String, String> nameValueMap;
+  private Map<String, String> nameValueMap;
   
   /**
    * 
    * @param content  Application-Content, Import-Package content
    */
   public ContentImpl(String content) {
-    Map<String, NameValueMap<String, String>> appContentsMap = ManifestHeaderProcessor.parseImportString(content);
+    Map<String, Map<String, String>> appContentsMap = ManifestHeaderProcessor.parseImportString(content);
     if (appContentsMap.size() != 1) {
       throw new IllegalArgumentException(MessageUtil.getMessage("APPUTILS0004E",content));
     }
-    for (Map.Entry<String, NameValueMap<String, String>> entry : appContentsMap.entrySet()) {
+    for (Map.Entry<String, Map<String, String>> entry : appContentsMap.entrySet()) {
       this.contentName = entry.getKey();
       this.nameValueMap= entry.getValue();
       setup();
@@ -61,14 +60,14 @@ public final class ContentImpl implement
   
   public ContentImpl (String bundleSymbolicName, Version version) { 
     this.contentName = bundleSymbolicName;
-    this.nameValueMap = new NameValueMap<String, String>();
+    this.nameValueMap = new HashMap<String, String>();
     nameValueMap.put("version", version.toString());
     setup();
   }
   
   public ContentImpl (String bundleSymbolicName, VersionRange version) { 
     this.contentName = bundleSymbolicName;
-    this.nameValueMap = new NameValueMap<String, String>();
+    this.nameValueMap = new HashMap<String, String>();
     nameValueMap.put("version", version.toString());
     setup();
   }
@@ -77,7 +76,7 @@ public final class ContentImpl implement
    * @param contentName  
    * @param nameValueMap
    */
-  public ContentImpl(String contentName, NameValueMap<String, String> nameValueMap) {
+  public ContentImpl(String contentName, Map<String, String> nameValueMap) {
     this.contentName = contentName;
     this.nameValueMap= nameValueMap;
     setup();
@@ -114,10 +113,10 @@ public final class ContentImpl implement
     return toReturn;
   }
   
-  public NameValueMap<String, String> getNameValueMap() {
-    NameValueMap<String, String> nvm = new NameValueMap<String, String>();
+  public Map<String, String> getNameValueMap() {
+    Map<String, String> nvm = new HashMap<String, String>();
     for (String key : this.nameValueMap.keySet()) {
-      nvm.addToCollection(key, this.nameValueMap.get(key));
+      nvm.put(key, this.nameValueMap.get(key));
     }
     return nvm;
   }

Modified: aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/DeploymentContentImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/DeploymentContentImpl.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/DeploymentContentImpl.java (original)
+++ aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/impl/DeploymentContentImpl.java Fri Jun  3 15:40:25 2011
@@ -19,18 +19,18 @@
 
 package org.apache.aries.application.impl;
 
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.aries.application.DeploymentContent;
 import org.apache.aries.application.utils.AppConstants;
 import org.apache.aries.util.VersionRange;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.osgi.framework.Version;
 
 public final class DeploymentContentImpl implements DeploymentContent {
   
-  private ContentImpl _content;
+  private final ContentImpl _content;
   
   /**
    * DeploymentContent relates to a bundle at a particular version. 
@@ -40,7 +40,7 @@ public final class DeploymentContentImpl
    * @param version
    */
   public DeploymentContentImpl (String bundleSymbolicName, Version version) {
-    NameValueMap<String, String> nvMap = new NameValueMap<String, String>();
+    Map<String, String> nvMap = new HashMap<String, String>();
     nvMap.put(AppConstants.DEPLOYMENT_BUNDLE_VERSION, version.toString());
     _content = new ContentImpl (bundleSymbolicName, nvMap);
   }
@@ -54,31 +54,38 @@ public final class DeploymentContentImpl
     _content = new ContentImpl (deployedContent);
   }
   
-  public Version getExactVersion() {
+  @Override
+public Version getExactVersion() {
     return getVersion().getExactVersion();
   }
 
-  public String getAttribute(String key) {
+  @Override
+public String getAttribute(String key) {
     return _content.getAttribute(key);
   }
 
-  public Map<String, String> getAttributes() {
+  @Override
+public Map<String, String> getAttributes() {
     return _content.getAttributes();
   }
 
-  public String getContentName() {
+  @Override
+public String getContentName() {
     return _content.getContentName();
   }
 
-  public String getDirective(String key) {
+  @Override
+public String getDirective(String key) {
     return _content.getDirective(key);
   }
 
-  public Map<String, String> getDirectives() {
+  @Override
+public Map<String, String> getDirectives() {
     return _content.getDirectives();
   }
 
-  public VersionRange getVersion() {
+  @Override
+public VersionRange getVersion() {
     String deployedVersion = _content.getAttribute(AppConstants.DEPLOYMENT_BUNDLE_VERSION);
     VersionRange vr = null;
     if (deployedVersion != null && deployedVersion.length() > 0) {
@@ -100,15 +107,18 @@ public final class DeploymentContentImpl
     }
   }
   
-  public int hashCode() {
+  @Override
+public int hashCode() {
     return _content.hashCode();
   }
 
-  public Map<String, String> getNameValueMap() {
+  @Override
+public Map<String, String> getNameValueMap() {
     return _content.getNameValueMap();
   }
   
-  public String toString()
+  @Override
+public String toString()
   {
     return _content.toString();
   }

Modified: aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/management/SimpleBundleInfo.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/management/SimpleBundleInfo.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/management/SimpleBundleInfo.java (original)
+++ aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/management/SimpleBundleInfo.java Fri Jun  3 15:40:25 2011
@@ -50,7 +50,7 @@ public final class SimpleBundleInfo impl
   public SimpleBundleInfo(BundleManifest bm, String location) { 
     _contentName = new ContentImpl(
         bm.getSymbolicName(), 
-        ManifestHeaderProcessor.parseBundleSymbolicName(bm.getSymbolicName()).getValue());
+        ManifestHeaderProcessor.parseBundleSymbolicName(bm.getSymbolicName()).getAttributes());
     _version = bm.getVersion();
     _attributes = bm.getRawAttributes();
     _location = location;

Modified: aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ContentFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ContentFactory.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ContentFactory.java (original)
+++ aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ContentFactory.java Fri Jun  3 15:40:25 2011
@@ -1,9 +1,10 @@
 package org.apache.aries.application.utils.manifest;
 
+import java.util.Map;
+
 import org.apache.aries.application.Content;
 import org.apache.aries.application.impl.ContentImpl;
 import org.apache.aries.util.manifest.ManifestHeaderProcessor;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 
 
 public class ContentFactory {
@@ -23,7 +24,7 @@ public class ContentFactory {
    * @param nameValueMap The map containing the content attributes/directives
    * @return a content object
    */
-  public static Content parseContent(String contentName, NameValueMap<String, String> nameValueMap) {
+  public static Content parseContent(String contentName, Map<String, String> nameValueMap) {
     return new ContentImpl(contentName, nameValueMap);
   }
 }

Modified: aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/ApplicationMetadataImplTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/ApplicationMetadataImplTest.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/ApplicationMetadataImplTest.java (original)
+++ aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/ApplicationMetadataImplTest.java Fri Jun  3 15:40:25 2011
@@ -21,7 +21,9 @@ package org.apache.aries.application.imp
 import static org.junit.Assert.*;
 
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import junit.framework.Assert;
 
@@ -30,7 +32,6 @@ import org.apache.aries.application.Appl
 import org.apache.aries.application.Content;
 import org.apache.aries.application.ServiceDeclaration;
 import org.apache.aries.application.impl.ApplicationMetadataFactoryImpl;
-import org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValueMap;
 import org.junit.Test;
 import org.osgi.framework.Version;
 
@@ -55,8 +56,8 @@ public class ApplicationMetadataImplTest
     List<Content> appContents = app.getApplicationContents();
     assertEquals(2, appContents.size());
     Content appContent1 = new ContentImpl("com.travel.reservation.business");
-    NameValueMap<String, String> attrs = new NameValueMap<String, String>();
-    attrs.addToCollection("version", "\"[1.1.0,1.2.0)\"");
+    Map<String, String> attrs = new HashMap<String, String>();
+    attrs.put("version", "\"[1.1.0,1.2.0)\"");
     Content appContent2 = new ContentImpl("com.travel.reservation.web", attrs);
     assertTrue(appContents.contains(appContent2));
     assertTrue(appContents.contains(appContent1));

Modified: aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/DeploymentContentImplTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/DeploymentContentImplTest.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/DeploymentContentImplTest.java (original)
+++ aries/trunk/application/application-utils/src/test/java/org/apache/aries/application/impl/DeploymentContentImplTest.java Fri Jun  3 15:40:25 2011
@@ -36,7 +36,7 @@ public class DeploymentContentImplTest {
     assertTrue(vi.isExactVersion());
     assertEquals(new Version("1.1.0"), dc.getExactVersion());
     assertEquals("com.travel.reservation.web", dc.getContentName());
-    assertEquals("{deployed-version->1.1.0}", dc.getNameValueMap().toString());
+    assertEquals("{deployed-version=1.1.0}", dc.getNameValueMap().toString());
   }
   
   @Test
@@ -47,7 +47,7 @@ public class DeploymentContentImplTest {
     assertTrue(vi.isExactVersion());
     assertEquals(new Version("2.0"), dc.getExactVersion());
     assertEquals("com.travel.reservation.business", dc.getContentName());
-    assertEquals("{deployed-version->2.0}", dc.getNameValueMap().toString());
+    assertEquals("{deployed-version=2.0}", dc.getNameValueMap().toString());
   }
   
   
@@ -59,7 +59,7 @@ public class DeploymentContentImplTest {
     assertTrue(vi.isExactVersion());
     assertEquals(new Version("2.1.1"), dc.getExactVersion());
     assertEquals("com.travel.reservation.data", dc.getContentName());
-    assertEquals("{deployed-version->2.1.1}", dc.getNameValueMap().toString());
+    assertEquals("{deployed-version=2.1.1}", dc.getNameValueMap().toString());
   }
 }
 

Modified: aries/trunk/util/src/main/java/org/apache/aries/util/manifest/BundleManifest.java
URL: http://svn.apache.org/viewvc/aries/trunk/util/src/main/java/org/apache/aries/util/manifest/BundleManifest.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/util/src/main/java/org/apache/aries/util/manifest/BundleManifest.java (original)
+++ aries/trunk/util/src/main/java/org/apache/aries/util/manifest/BundleManifest.java Fri Jun  3 15:40:25 2011
@@ -165,7 +165,7 @@ public class BundleManifest
 
     String result = null;
     if (rawSymName != null) {
-      NameValuePair<String, NameValueMap<String, String>> info = ManifestHeaderProcessor.parseBundleSymbolicName(rawSymName);
+      NameValuePair info = ManifestHeaderProcessor.parseBundleSymbolicName(rawSymName);
       result = info.getName();
     }
     

Modified: aries/trunk/util/src/main/java/org/apache/aries/util/manifest/ManifestHeaderProcessor.java
URL: http://svn.apache.org/viewvc/aries/trunk/util/src/main/java/org/apache/aries/util/manifest/ManifestHeaderProcessor.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/util/src/main/java/org/apache/aries/util/manifest/ManifestHeaderProcessor.java (original)
+++ aries/trunk/util/src/main/java/org/apache/aries/util/manifest/ManifestHeaderProcessor.java Fri Jun  3 15:40:25 2011
@@ -46,33 +46,36 @@ public class ManifestHeaderProcessor
    * @param <N> The type for the 'Name'
    * @param <V> The type for the 'Value'
    */
-  public static class NameValuePair<N,V>{
-    private N name;
-    private V value;
-    public NameValuePair(N name, V value)
+  public static class NameValuePair {
+    private String name;
+    private Map<String,String> attributes;
+    
+    public NameValuePair(String name, Map<String,String> value)
     {
       this.name = name;
-      this.value = value;
+      this.attributes = value;
     }
-    public N getName()
+    public String getName()
     {
       return name;
     }
-    public void setName(N name)
+    public void setName(String name)
     {
       this.name = name;
     }
-    public V getValue()
+    
+    public Map<String,String> getAttributes()
     {
-      return value;
+      return attributes;
     }
-    public void setValue(V value)
+    public void setAttributes(Map<String,String> value)
     {
-      this.value = value;
+      this.attributes = value;
     }
+    
     @Override
     public String toString(){
-      return "{"+name.toString()+"::"+value.toString()+"}";
+      return "{"+name.toString()+"::"+attributes.toString()+"}";
     }
     @Override
     public int hashCode()
@@ -80,7 +83,7 @@ public class ManifestHeaderProcessor
       final int prime = 31;
       int result = 1;
       result = prime * result + ((name == null) ? 0 : name.hashCode());
-      result = prime * result + ((value == null) ? 0 : value.hashCode());
+      result = prime * result + ((attributes == null) ? 0 : attributes.hashCode());
       return result;
     }
     @Override
@@ -89,13 +92,13 @@ public class ManifestHeaderProcessor
       if (this == obj) return true;
       if (obj == null) return false;
       if (getClass() != obj.getClass()) return false;
-      final NameValuePair<?, ?> other = (NameValuePair<?, ?>) obj;
+      final NameValuePair other = (NameValuePair) obj;
       if (name == null) {
         if (other.name != null) return false;
       } else if (!name.equals(other.name)) return false;
-      if (value == null) {
-        if (other.value != null) return false;
-      } else if (!value.equals(other.value)) return false;
+      if (attributes == null) {
+    	  if (other.attributes != null) return false;
+      } else if (!attributes.equals(other.attributes)) return false;
       return true;
     }
   }
@@ -107,13 +110,13 @@ public class ManifestHeaderProcessor
    * @param <N> Type of 'Name'
    * @param <V> Type of 'Value'
    */
-  public static interface NameValueCollection<N,V>{
+  public static interface NameValueCollection {
     /**
      * Add this Name & Value to the collection.
      * @param n
      * @param v
      */
-    public void addToCollection(N n,V v);
+    public void addToCollection(String n, Map<String,String> v);
   }
 
   /**
@@ -122,17 +125,19 @@ public class ManifestHeaderProcessor
    * @param <N> Type of 'Name'
    * @param <V> Type of 'Value'
    */
-  public static class NameValueMap<N,V> extends HashMap<N,V> implements NameValueCollection<N,V>, Map<N,V>{
-	    
-   public void addToCollection(N n,V v){
+  public static class NameValueMap extends HashMap<String, Map<String,String>> implements NameValueCollection, Map<String, Map<String,String>>{
+	private static final long serialVersionUID = -6446338858542599141L;
+	
+	public void addToCollection(String n, Map<String,String> v){
       this.put(n,v);
     }
-   @Override
-   public String toString(){
+	
+	@Override
+	public String toString(){
       StringBuilder sb = new StringBuilder();
       sb.append("{");
       boolean first=true;
-      for(Map.Entry<N, V> entry : this.entrySet()){
+      for(Map.Entry<String, Map<String,String>> entry : this.entrySet()){
         if(!first)sb.append(",");
         first=false;
         sb.append(entry.getKey()+"->"+entry.getValue());
@@ -148,17 +153,18 @@ public class ManifestHeaderProcessor
    * @param <N> Type of 'Name'
    * @param <V> Type of 'Value'
    */
-  public static class NameValueList<N,V> extends ArrayList<NameValuePair<N,V>> implements NameValueCollection<N,V>, List<NameValuePair<N,V>>{    
-
-	public void addToCollection(N n,V v){
-      this.add(new NameValuePair<N,V>(n,v));
+  public static class NameValueList extends ArrayList<NameValuePair> implements NameValueCollection, List<NameValuePair> {    
+	private static final long serialVersionUID = 1808636823825029983L;
+	
+	public void addToCollection(String n, Map<String,String> v){
+      this.add(new NameValuePair(n,v));
     } 
 	@Override
     public String toString(){
       StringBuffer sb = new StringBuffer();
       sb.append("{");
       boolean first = true;
-      for(NameValuePair<N, V> nvp : this){
+      for(NameValuePair nvp : this){
         if(!first)sb.append(",");
         first=false;
         sb.append(nvp.toString());        
@@ -201,15 +207,15 @@ public class ManifestHeaderProcessor
    * @return a list of NameValuePair, with the Name being the name component, 
    *         and the Value being a NameValueMap of key->value mappings.   
    */
-  private static List<NameValuePair<String, NameValueMap<String, String>>> genericNameWithNameValuePairProcess(String s){    
+  private static List<NameValuePair> genericNameWithNameValuePairProcess(String s){    
     String name;
-    NameValueMap<String,String> params = null;
-    List<NameValuePair<String, NameValueMap<String, String>>> nameValues = new ArrayList<NameValuePair<String, NameValueMap<String, String>>>();
+    Map<String,String> params = null;
+    List<NameValuePair> nameValues = new ArrayList<NameValuePair>();
     List<String> pkgs = new ArrayList<String>();
     int index = s.indexOf(";");
     if(index==-1){
       name = s;
-      params = new NameValueMap<String, String>();
+      params = new HashMap<String, String>();
       pkgs.add(name);
     }else{       
       name = s.substring(0,index).trim();
@@ -251,7 +257,7 @@ public class ManifestHeaderProcessor
       
     }
     for (String pkg : pkgs) {
-      nameValues.add(new NameValuePair<String, NameValueMap<String, String>>(pkg,params));
+      nameValues.add(new NameValuePair(pkg,params));
     }  
     
     return nameValues;
@@ -269,8 +275,8 @@ public class ManifestHeaderProcessor
    * @param s data to parse
    * @return a NameValueMap, with attribute-name -> attribute-value.
    */
-  private static NameValueMap<String,String> genericNameValueProcess(String s){
-    NameValueMap<String,String> params = new NameValueMap<String,String>();  
+  private static Map<String,String> genericNameValueProcess(String s){
+    Map<String,String> params = new HashMap<String,String>();  
     List<String> parameters = split(s, ";");
     for(String parameter : parameters) {
       List<String> parts = split(parameter,"=");
@@ -301,12 +307,12 @@ public class ManifestHeaderProcessor
    * @param out The collection to add each package name + attrib map to.
    * @param s The data to parse
    */
-  private static void genericImportExportProcess(NameValueCollection<String, NameValueMap<String,String>>out, String s){
+  private static void genericImportExportProcess(NameValueCollection out, String s){
     List<String> packages = split(s, ",");
     for(String pkg : packages){   
-      List<NameValuePair<String, NameValueMap<String, String>>> ps = genericNameWithNameValuePairProcess(pkg);
-      for (NameValuePair<String, NameValueMap<String, String>> p : ps) {
-        out.addToCollection(p.getName(), p.getValue());
+      List<NameValuePair> ps = genericNameWithNameValuePairProcess(pkg);
+      for (NameValuePair p : ps) {
+        out.addToCollection(p.getName(), p.getAttributes());
       }
     }    
   }
@@ -321,8 +327,8 @@ public class ManifestHeaderProcessor
    * @return List of NameValuePairs, where each Name in the list is an exported package, 
    *         with its associated Value being a NameValueMap of any attributes declared. 
    */
-  public static List<NameValuePair<String, NameValueMap<String, String>>> parseExportString(String s){
-    NameValueList<String, NameValueMap<String, String>> retval = new NameValueList<String, NameValueMap<String, String>>();
+  public static List<NameValuePair> parseExportString(String s){
+    NameValueList retval = new NameValueList();
     genericImportExportProcess(retval, s);
     return retval;
   }
@@ -339,12 +345,12 @@ public class ManifestHeaderProcessor
    * @return List of NameValuePairs, where each Name in the list is an exported package, 
    *         with its associated Value being a NameValueMap of any attributes declared. 
    */
-  public static List<NameValuePair<String, NameValueMap<String, String>>> parseExportList(List<String> list){
-    NameValueList<String, NameValueMap<String, String>> retval = new NameValueList<String, NameValueMap<String, String>>();
+  public static List<NameValuePair> parseExportList(List<String> list){
+    NameValueList retval = new NameValueList();
     for(String pkg : list){   
-      List<NameValuePair<String, NameValueMap<String, String>>> ps = genericNameWithNameValuePairProcess(pkg);
-      for (NameValuePair<String, NameValueMap<String, String>> p : ps) {
-        retval.addToCollection(p.getName(), p.getValue());
+      List<NameValuePair> ps = genericNameWithNameValuePairProcess(pkg);
+      for (NameValuePair p : ps) {
+        retval.addToCollection(p.getName(), p.getAttributes());
       }
     } 
     return retval;
@@ -360,8 +366,8 @@ public class ManifestHeaderProcessor
    * @return Map of NameValuePairs, where each Key in the Map is an imported package, 
    *         with its associated Value being a NameValueMap of any attributes declared. 
    */  
-  public static Map<String, NameValueMap<String, String>> parseImportString(String s){
-    NameValueMap<String, NameValueMap<String, String>> retval = new NameValueMap<String, NameValueMap<String, String>>();
+  public static Map<String, Map<String, String>> parseImportString(String s){
+    NameValueMap retval = new NameValueMap();
     genericImportExportProcess(retval, s);
     return retval;    
   }
@@ -375,7 +381,7 @@ public class ManifestHeaderProcessor
    * @return NameValuePair with Name being the BundleSymbolicName, 
    *         and Value being any attribs declared for the name. 
    */   
-  public static NameValuePair<String, NameValueMap<String, String>> parseBundleSymbolicName(String s){
+  public static NameValuePair parseBundleSymbolicName(String s){
     return genericNameWithNameValuePairProcess(s).get(0); // should just return the first one
   }
   

Modified: aries/trunk/util/src/test/java/org/apache/aries/util/manifest/ManifestHeaderProcessorTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/util/src/test/java/org/apache/aries/util/manifest/ManifestHeaderProcessorTest.java?rev=1131077&r1=1131076&r2=1131077&view=diff
==============================================================================
--- aries/trunk/util/src/test/java/org/apache/aries/util/manifest/ManifestHeaderProcessorTest.java (original)
+++ aries/trunk/util/src/test/java/org/apache/aries/util/manifest/ManifestHeaderProcessorTest.java Fri Jun  3 15:40:25 2011
@@ -27,6 +27,7 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -40,37 +41,47 @@ public class ManifestHeaderProcessorTest
 {
   @Test
   public void testNameValuePair() throws Exception {
-    NameValuePair<String, String> nvp = new NameValuePair<String, String>("key", "value");
+	HashMap<String, String> attrs = new HashMap<String, String>();
+	attrs.put("some", "value");
+    NameValuePair nvp = new NameValuePair("key", attrs);
+    
     assertEquals("The name value pair is not set properly.", nvp.getName(), "key");
-    assertEquals("The value is not set properly.", nvp.getValue(), "value");
-    NameValuePair<String, String> anotherNvp = new NameValuePair<String, String>("key", "value");
+    assertEquals("The value is not set properly.", nvp.getAttributes().get("some"), "value");
+    
+	attrs = new HashMap<String, String>();
+	attrs.put("some", "value");
+    NameValuePair anotherNvp = new NameValuePair("key", attrs);
     assertEquals("The two objects of NameValuePair is not equal.", nvp, anotherNvp);
+
     nvp.setName("newKey");
-    nvp.setValue("newValue");
+    attrs = new HashMap<String, String>();
+	attrs.put("some", "newValue");
+    nvp.setAttributes(attrs);
     assertEquals("The name value pair is not set properly.", nvp.getName(), "newKey");
-    assertEquals("The value is not set properly.", nvp.getValue(), "newValue");
+    assertEquals("The value is not set properly.", nvp.getAttributes().get("some"), "newValue");
     
-    NameValueMap<String,String> nvm1 = new NameValueMap<String,String>();
+    Map<String,String> nvm1 = new HashMap<String,String>();
     nvm1.put("a","b");
     nvm1.put("c","d");
-    NameValueMap<String,String> nvm2 = new NameValueMap<String,String>();
+    
+    Map<String,String> nvm2 = new HashMap<String,String>();
     nvm2.put("c","d");
     nvm2.put("a","b");
     assertEquals("The maps are not equal.", nvm1, nvm2);
     nvm2.put("e","f");
     assertNotSame("The maps are the same.", nvm1, nvm2);
     
-    NameValuePair<String, NameValueMap<String,String>> nvp1 = new NameValuePair<String,NameValueMap<String,String>>("one",nvm1);
-    NameValuePair<String, NameValueMap<String,String>> nvp2 = new NameValuePair<String,NameValueMap<String,String>>("one",nvm2);
+    NameValuePair nvp1 = new NameValuePair("one",nvm1);
+    NameValuePair nvp2 = new NameValuePair("one",nvm2);
     
     assertNotSame("The pairs are identical ",nvp1,nvp2);
     nvm1.put("e","f");
     assertEquals("The pairs are not equal.", nvp1,nvp2);
     
-    List<NameValuePair<String, NameValueMap<String,String>>> bundleInfoList1 = new ArrayList<NameValuePair<String, NameValueMap<String,String>>>();
+    List<NameValuePair> bundleInfoList1 = new ArrayList<NameValuePair>();
     bundleInfoList1.add(nvp1);
 
-    List<NameValuePair<String, NameValueMap<String,String>>> bundleInfoList2 = new ArrayList<NameValuePair<String, NameValueMap<String,String>>>();
+    List<NameValuePair> bundleInfoList2 = new ArrayList<NameValuePair>();
     bundleInfoList2.add(nvp1);
     
     bundleInfoList1.removeAll(bundleInfoList2);
@@ -89,18 +100,14 @@ public class ManifestHeaderProcessorTest
   public void testParseBundleSymbolicName() 
   {
     String bundleSymbolicNameEntry = "com.acme.foo;singleton:=true;fragment-attachment:=always";
-    NameValuePair<String, NameValueMap<String, String>> nvp = ManifestHeaderProcessor.parseBundleSymbolicName(bundleSymbolicNameEntry);
+    NameValuePair nvp = ManifestHeaderProcessor.parseBundleSymbolicName(bundleSymbolicNameEntry);
     assertEquals("The symbolic name is wrong.", nvp.getName(), "com.acme.foo");
-    assertEquals("The value is wrong.", "true", nvp.getValue().get("singleton:") );
-    assertEquals("The directive is wrong.", "always", nvp.getValue().get("fragment-attachment:") );
+    assertEquals("The value is wrong.", "true", nvp.getAttributes().get("singleton:") );
+    assertEquals("The directive is wrong.", "always", nvp.getAttributes().get("fragment-attachment:") );
   
     String bundleSymbolicNameEntry2 = "com.acme.foo";
-    NameValuePair<String, NameValueMap<String, String>> nvp2 = ManifestHeaderProcessor.parseBundleSymbolicName(bundleSymbolicNameEntry2);
+    NameValuePair nvp2 = ManifestHeaderProcessor.parseBundleSymbolicName(bundleSymbolicNameEntry2);
     assertEquals("The symbolic name is wrong.", nvp2.getName(), "com.acme.foo");
-    
-    
-  
-  
   }
   
  
@@ -114,7 +121,7 @@ public class ManifestHeaderProcessorTest
   {
     String importPackage = "com.acme.foo,come.acm.e.bar;version=\"[1.23,1.24.5]\";resolution:=mandatory;company=\"ACME\",a.b.c;version=1.2.3;company=com";
   
-    Map<String, NameValueMap<String, String>> importPackageReturn = ManifestHeaderProcessor.parseImportString(importPackage);
+    Map<String, Map<String, String>> importPackageReturn = ManifestHeaderProcessor.parseImportString(importPackage);
   
     assertTrue("The package is not set.", importPackageReturn.containsKey("com.acme.foo"));
     assertTrue("The package is not set.", importPackageReturn.containsKey("come.acm.e.bar"));
@@ -133,39 +140,40 @@ public class ManifestHeaderProcessorTest
     assertTrue("The package should not contain any attributes.", importPackageReturn.get("com.acme.foo").isEmpty());
     
     importPackage="com.acme.foo;com.acme.bar;version=2";
-    Map<String, NameValueMap<String, String>> importPackageReturn2 = ManifestHeaderProcessor.parseImportString(importPackage);
+    Map<String, Map<String, String>> importPackageReturn2 = ManifestHeaderProcessor.parseImportString(importPackage);
     assertTrue("The package is not set.", importPackageReturn2.containsKey("com.acme.foo"));
     assertTrue("The package is not set.", importPackageReturn2.containsKey("com.acme.bar"));
     assertEquals("The directive is not set correctly.", "2", importPackageReturn2.get("com.acme.foo").get("version"));
     assertEquals("The directive is not set correctly.", "2", importPackageReturn2.get("com.acme.bar").get("version"));
   }
+  
   @Test
   public void testParseExportString()
   {
     String exportPackage = "com.acme.foo,com.acme.bar;version=1,com.acme.bar;version=2;uses:=\"a.b.c,d.e.f\";security=false;mandatory:=security";
   
-    List<NameValuePair<String, NameValueMap<String, String>>> exportPackageReturn = ManifestHeaderProcessor.parseExportString(exportPackage);
+    List<NameValuePair> exportPackageReturn = ManifestHeaderProcessor.parseExportString(exportPackage);
     
     int i =0;
     assertEquals("The number of the packages is wrong.", 3, exportPackageReturn.size());
-    for (NameValuePair<String, NameValueMap<String, String>> nvp : exportPackageReturn) {
+    for (NameValuePair nvp : exportPackageReturn) {
       if (nvp.getName().equals("com.acme.foo")) {
         i++;
         
-        assertTrue("The directive or attribute should not be set.", nvp.getValue().isEmpty() );
-      } else if ((nvp.getName().equals("com.acme.bar")) && ("2".equals(nvp.getValue().get("version")))) {
+        assertTrue("The directive or attribute should not be set.", nvp.getAttributes().isEmpty() );
+      } else if ((nvp.getName().equals("com.acme.bar")) && ("2".equals(nvp.getAttributes().get("version")))) {
       
         
         i++;
-        assertEquals("The directive is wrong.", "a.b.c,d.e.f", nvp.getValue().get("uses:"));
-        assertEquals("The directive is wrong.", "false", nvp.getValue().get("security"));
-        assertEquals("The directive is wrong.", "security", nvp.getValue().get("mandatory:"));
-      } else if ((nvp.getName().equals("com.acme.bar")) && ("1".equals(nvp.getValue().get("version")))) {
+        assertEquals("The directive is wrong.", "a.b.c,d.e.f", nvp.getAttributes().get("uses:"));
+        assertEquals("The directive is wrong.", "false", nvp.getAttributes().get("security"));
+        assertEquals("The directive is wrong.", "security", nvp.getAttributes().get("mandatory:"));
+      } else if ((nvp.getName().equals("com.acme.bar")) && ("1".equals(nvp.getAttributes().get("version")))) {
         i++;
         
-        assertNull("The directive is wrong.", nvp.getValue().get("uses:"));
-        assertNull("The directive is wrong.", nvp.getValue().get("security"));
-        assertNull("The directive is wrong.", nvp.getValue().get("mandatory:"));
+        assertNull("The directive is wrong.", nvp.getAttributes().get("uses:"));
+        assertNull("The directive is wrong.", nvp.getAttributes().get("security"));
+        assertNull("The directive is wrong.", nvp.getAttributes().get("mandatory:"));
       }
     }
     // make sure all three packages stored
@@ -177,11 +185,11 @@ public class ManifestHeaderProcessorTest
     
     int k =0;
     assertEquals("The number of the packages is wrong.", 1, exportPackageReturn.size());
-    for (NameValuePair<String, NameValueMap<String, String>> nvp : exportPackageReturn) {
+    for (NameValuePair nvp : exportPackageReturn) {
       if (nvp.getName().equals("com.acme.foo")) {
         k++;
         
-        assertTrue("The directive or attribute should not be set.", nvp.getValue().isEmpty() );
+        assertTrue("The directive or attribute should not be set.", nvp.getAttributes().isEmpty() );
       } 
     }
     assertEquals("The names of the packages are wrong.", 1, k);
@@ -194,45 +202,45 @@ public class ManifestHeaderProcessorTest
     
     k =0;
     assertEquals("The number of the packages is wrong.", 2, exportPackageReturn.size());
-    for (NameValuePair<String, NameValueMap<String, String>> nvp : exportPackageReturn) {
+    for (NameValuePair nvp : exportPackageReturn) {
       if (nvp.getName().equals("com.acme.foo")) {
         k++;
         
-        assertEquals("The attribute is wrong.", "2", nvp.getValue().get("version") );
-        assertEquals("The attribute is wrong.", "optional", nvp.getValue().get("resolution:"));
+        assertEquals("The attribute is wrong.", "2", nvp.getAttributes().get("version") );
+        assertEquals("The attribute is wrong.", "optional", nvp.getAttributes().get("resolution:"));
       } else if (nvp.getName().equals("com.acme.bar")) {
         k++;
         
-        assertEquals("The attribute is wrong.", "2", nvp.getValue().get("version") );
-        assertEquals("The attribute is wrong.", "optional", nvp.getValue().get("resolution:"));
+        assertEquals("The attribute is wrong.", "2", nvp.getAttributes().get("version") );
+        assertEquals("The attribute is wrong.", "optional", nvp.getAttributes().get("resolution:"));
       }
     }
     assertEquals("The names of the packages are wrong.", 2, k);
     
     exportPackageReturn = ManifestHeaderProcessor.parseExportString("some.export.with.space.in;directive := spacey");
-    assertEquals(exportPackageReturn.toString(), "spacey", exportPackageReturn.get(0).getValue().get("directive:"));
+    assertEquals(exportPackageReturn.toString(), "spacey", exportPackageReturn.get(0).getAttributes().get("directive:"));
   }
     
     @Test
     public void testExportMandatoryAttributes() {
       String exportPackage = "com.acme.foo,com.acme.bar;version=2;company=dodo;security=false;mandatory:=\"security,company\"";
       
-      List<NameValuePair<String, NameValueMap<String, String>>> exportPackageReturn = ManifestHeaderProcessor.parseExportString(exportPackage);
+      List<NameValuePair> exportPackageReturn = ManifestHeaderProcessor.parseExportString(exportPackage);
       
       int i =0;
       assertEquals("The number of the packages is wrong.", 2, exportPackageReturn.size());
-      for (NameValuePair<String, NameValueMap<String, String>> nvp : exportPackageReturn) {
+      for (NameValuePair nvp : exportPackageReturn) {
         if (nvp.getName().equals("com.acme.foo")) {
           i++;
           
-          assertTrue("The directive or attribute should not be set.", nvp.getValue().isEmpty() );
-        } else if ((nvp.getName().equals("com.acme.bar")) && ("2".equals(nvp.getValue().get("version")))) {
+          assertTrue("The directive or attribute should not be set.", nvp.getAttributes().isEmpty() );
+        } else if ((nvp.getName().equals("com.acme.bar")) && ("2".equals(nvp.getAttributes().get("version")))) {
         
           
           i++;
-          assertEquals("The directive is wrong.", "dodo", nvp.getValue().get("company"));
-          assertEquals("The directive is wrong.", "false", nvp.getValue().get("security"));
-          assertEquals("The directive is wrong.", "security,company", nvp.getValue().get("mandatory:"));
+          assertEquals("The directive is wrong.", "dodo", nvp.getAttributes().get("company"));
+          assertEquals("The directive is wrong.", "false", nvp.getAttributes().get("security"));
+          assertEquals("The directive is wrong.", "security,company", nvp.getAttributes().get("mandatory:"));
         } 
       }
       // make sure all three packages stored
@@ -240,7 +248,7 @@ public class ManifestHeaderProcessorTest
       
     }
     
-    private String createExpectedFilter(NameValueMap<String, String> values, String ... parts)
+    private String createExpectedFilter(Map<String, String> values, String ... parts)
     {
       StringBuilder builder = new StringBuilder(parts[0]);
       
@@ -260,10 +268,10 @@ public class ManifestHeaderProcessorTest
      */
     @Test
     public void testGenerateFilter() throws Exception {
-      NameValueMap<String, String> valueMap = new NameValueMap<String, String>();
-      valueMap.addToCollection("version", "[1.2, 2.3]");
-      valueMap.addToCollection("resulution:", "mandatory");
-      valueMap.addToCollection("company", "com");
+      Map<String, String> valueMap = new HashMap<String, String>();
+      valueMap.put("version", "[1.2, 2.3]");
+      valueMap.put("resulution:", "mandatory");
+      valueMap.put("company", "com");
       String filter = ManifestHeaderProcessor.generateFilter("symbolic-name", "com.ibm.foo", valueMap);
       String expected = createExpectedFilter(valueMap, "(&(symbolic-name=com.ibm.foo)", "(company=com)", "(version>=1.2.0)(version<=2.3.0)", "(mandatory:<*company))");
       assertEquals("The filter is wrong.", expected, filter );
@@ -271,35 +279,35 @@ public class ManifestHeaderProcessorTest
       
       valueMap.clear();
       
-      valueMap.addToCollection("version", "(1.2, 2.3]");
-      valueMap.addToCollection("resulution:", "mandatory");
-      valueMap.addToCollection("company", "com");
+      valueMap.put("version", "(1.2, 2.3]");
+      valueMap.put("resulution:", "mandatory");
+      valueMap.put("company", "com");
       filter = ManifestHeaderProcessor.generateFilter("symbolic-name", "com.ibm.foo", valueMap);
       expected = createExpectedFilter(valueMap, "(&(symbolic-name=com.ibm.foo)", "(company=com)", "(version>=1.2.0)(version<=2.3.0)(!(version=1.2.0))", "(mandatory:<*company))");
       assertEquals("The filter is wrong.", expected, filter );
       
       valueMap.clear();
       
-      valueMap.addToCollection("version", "(1.2, 2.3)");
-      valueMap.addToCollection("resulution:", "mandatory");
-      valueMap.addToCollection("company", "com");
+      valueMap.put("version", "(1.2, 2.3)");
+      valueMap.put("resulution:", "mandatory");
+      valueMap.put("company", "com");
       filter = ManifestHeaderProcessor.generateFilter("symbolic-name", "com.ibm.foo", valueMap);
       expected = createExpectedFilter(valueMap, "(&(symbolic-name=com.ibm.foo)", "(company=com)", "(version>=1.2.0)(version<=2.3.0)(!(version=1.2.0))(!(version=2.3.0))", "(mandatory:<*company))");
       assertEquals("The filter is wrong.", expected, filter );
       
       valueMap.clear();
       
-      valueMap.addToCollection("version", "1.2");
-      valueMap.addToCollection("resulution:", "mandatory");
-      valueMap.addToCollection("company", "com");
+      valueMap.put("version", "1.2");
+      valueMap.put("resulution:", "mandatory");
+      valueMap.put("company", "com");
       filter = ManifestHeaderProcessor.generateFilter("symbolic-name", "com.ibm.foo", valueMap);
       expected = createExpectedFilter(valueMap, "(&(symbolic-name=com.ibm.foo)", "(company=com)", "(version>=1.2.0)", "(mandatory:<*company))");
       assertEquals("The filter is wrong.", expected, filter );
       
       valueMap.clear();
       
-      valueMap.addToCollection("resulution:", "mandatory");
-      valueMap.addToCollection("company", "com");
+      valueMap.put("resulution:", "mandatory");
+      valueMap.put("company", "com");
       filter = ManifestHeaderProcessor.generateFilter("symbolic-name", "com.ibm.foo", valueMap);
       expected = createExpectedFilter(valueMap, "(&(symbolic-name=com.ibm.foo)", "(company=com)", "", "(mandatory:<*company))");
       assertEquals("The filter is wrong.", expected, filter );



Mime
View raw message