On 16/09/2026 23:10, [email protected] wrote:
This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 67b53ec403 Add utility class to restore layout in the new XML file
67b53ec403 is described below
commit 67b53ec40302d61c9c329aa5f547ea4b31d5399e
Author: remm <[email protected]>
AuthorDate: Thu Sep 17 00:09:55 2026 +0200
Add utility class to restore layout in the new XML file
AI review comments. I've given them a quick sanity check and they look
valid. I've also edited them for brevity.
CoPilot:
java/org/apache/catalina/storeconfig/StandardContextSF.java:143-150
new FileOutputStream(config) truncates the existing context XML before
XMLFormatPreserver.preserve(config, ...) reads it. Saving an existing
context therefore loses its comments and formatting.
java/org/apache/catalina/storeconfig/XMLFormatPreserver.java:150-158,335-392
Only descendants are matched; fresh.root.match is never assigned. Root
attribute order and comments immediately before the root closing tag are
consequently discarded.
java/org/apache/catalina/storeconfig/XMLFormatPreserver.java:242-251
Equal empty attribute sets receive the maximum match score before text
is considered. Repeated elements such as WatchedResource are therefore
matched by position rather than content, potentially transferring a
removed entry’s comment to a retained entry.
Claude:
Reports the same StandardContextSF issue.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]