DanielThomas commented on code in PR #36:
URL:
https://github.com/apache/tomcat-jakartaee-migration/pull/36#discussion_r1005151612
##########
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:
> some jars are converted, some are not, but information for the unconverted
jars is changed
`Attributes` is a `HashMap` so in many cases, reading and writing the
manifest in this way is causing the key order to change, which is why I
switched to always writing `destManifest`. If the intention was to write the
manifest unchanged, we'd write the original bytes instead, and use another way
to determine if only implementation version was changed for the conversion
return value.
Edit: In fact, I'll do just that and it occurs to me that signatures should
get the same handling. Let me get another commit up and see what you think.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]