This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git

commit 67cc4f94eb64cdd56151c5b2fe6b52ef669104ce
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Feb 8 17:39:55 2021 +0000

    Fix duplicate conversion
---
 .../apache/tomcat/jakartaee/ManifestConverter.java | 25 +++++-----------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java 
b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
index 667a00e..3a89ae2 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
@@ -53,7 +53,6 @@ public class ManifestConverter implements Converter {
         Manifest destManifest = new Manifest(srcManifest);
 
         removeSignatures(destManifest);
-        updateVersion(destManifest);
         updateValues(destManifest, profile);
 
         destManifest.write(dest);
@@ -91,22 +90,6 @@ public class ManifestConverter implements Converter {
     }
 
 
-    private void updateVersion(Manifest manifest) {
-        updateVersion(manifest.getMainAttributes());
-        for (Attributes attributes : manifest.getEntries().values()) {
-            updateVersion(attributes);
-        }
-    }
-
-
-    private void updateVersion(Attributes attributes) {
-        if (attributes.containsKey(Attributes.Name.IMPLEMENTATION_VERSION)) {
-            String newValue = 
attributes.get(Attributes.Name.IMPLEMENTATION_VERSION) + "-" + 
Info.getVersion();
-            attributes.put(Attributes.Name.IMPLEMENTATION_VERSION, newValue);
-        }
-    }
-
-
     private void updateValues(Manifest manifest, EESpecProfile profile) {
         updateValues(manifest.getMainAttributes(), profile);
         for (Attributes attributes : manifest.getEntries().values()) {
@@ -116,12 +99,14 @@ public class ManifestConverter implements Converter {
 
 
     private void updateValues(Attributes attributes, EESpecProfile profile) {
-        for (Entry<Object,Object> entry : attributes.entrySet()) {
-            entry.setValue(profile.convert((String) entry.getValue()));
-        }
+        // Update version info
         if (attributes.containsKey(Attributes.Name.IMPLEMENTATION_VERSION)) {
             String newValue = 
attributes.get(Attributes.Name.IMPLEMENTATION_VERSION) + "-" + 
Info.getVersion();
             attributes.put(Attributes.Name.IMPLEMENTATION_VERSION, newValue);
         }
+        // Update package names in values
+        for (Entry<Object,Object> entry : attributes.entrySet()) {
+            entry.setValue(profile.convert((String) entry.getValue()));
+        }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to