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

2022-10-25 Thread GitBox


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


##
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:
   Here it is still necessary to revert, as the conversion is fine for the 
specified jar, but for directory migration via the migrator, the manifest of 
some jars here will be affected(some jars are converted, some are not, but 
information for the unconverted jars is changed), even if the jar is not 
converted.



-- 
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-unsubscr...@tomcat.apache.org

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


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



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

2022-10-25 Thread GitBox


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


##
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:
   This change raises the problem that if `IMPLEMENTATION_VERSION` exists, it 
must not be the original version content, even if the rest of the content has 
not been converted.



-- 
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-unsubscr...@tomcat.apache.org

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


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



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

2022-10-25 Thread GitBox


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


##
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:
   This change raises the problem that if a version number exists, it must not 
be the original version number, even if the rest of the content has not been 
converted.



-- 
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-unsubscr...@tomcat.apache.org

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


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



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

2022-10-25 Thread GitBox


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


##
src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java:
##
@@ -112,7 +107,7 @@ private boolean updateValues(Attributes attributes, 
EESpecProfile profile) {
 if (attributes.containsKey(Attributes.Name.IMPLEMENTATION_VERSION)) {
 String newValue = 
attributes.get(Attributes.Name.IMPLEMENTATION_VERSION) + "-" + 
Info.getVersion();
 attributes.put(Attributes.Name.IMPLEMENTATION_VERSION, newValue);
-result = true;
+// Purposefully avoid setting result

Review Comment:
   Changing the version also counts as a conversion, so here need to revert.



-- 
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-unsubscr...@tomcat.apache.org

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


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