You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2022/10/24 05:41:59 UTC

[GitHub] [tomcat-jakartaee-migration] DanielThomas commented on a diff in pull request #36: Improve composability when using from other tools

DanielThomas commented on code in PR #36:
URL: https://github.com/apache/tomcat-jakartaee-migration/pull/36#discussion_r1002897456


##########
src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java:
##########
@@ -48,20 +48,16 @@ public boolean accepts(String filename) {
     }
 
     @Override
-    public void convert(String path, InputStream src, OutputStream dest, EESpecProfile profile) throws IOException {
+    public boolean convert(String path, InputStream src, OutputStream dest, EESpecProfile profile) throws IOException {
         Manifest srcManifest = new Manifest(src);
         Manifest destManifest = new Manifest(srcManifest);
 
-        boolean result = false;
-
-        result = result | removeSignatures(destManifest);
+        boolean result = removeSignatures(destManifest);
         result = result | updateValues(destManifest, profile);
 
-        if (result) {
-            destManifest.write(dest);
-        } else {
-            srcManifest.write(dest);

Review Comment:
   In testing, I found that writing the source manifest doesn't guarantee the order of attributes, so the manifest differs even with no value changes (comparing using `pkgdiff`). This and the change below allows the implementation version to change only when other conversions were also made.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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