Skip to content

Validate duplicate TLD functions during parsing - #1055

Draft
sainadh777 wants to merge 1 commit into
apache:mainfrom
sainadh777:fix/tld-duplicate-function-validation
Draft

Validate duplicate TLD functions during parsing#1055
sainadh777 wants to merge 1 commit into
apache:mainfrom
sainadh777:fix/tld-duplicate-function-validation

Conversation

@sainadh777

Copy link
Copy Markdown
Contributor

Summary

  • detect duplicate TLD function names while the descriptor is parsed
  • remove the later duplicate-name pass from TagLibraryInfoImpl
  • add parser-level regression coverage and complete checked-in TODO 32.1

Rationale and impact

The TLD data model now rejects a duplicate as soon as the second function is added during parsing. This keeps descriptor validation with the parser, avoids constructing a partially invalid TaglibXml, and preserves the existing user-visible validation behavior with a message owned by the TLD descriptor package.

The change is limited to duplicate function-name validation. Valid tag libraries are unaffected.

Validation

All commands ran with Eclipse Temurin JDK 25 and Ant 1.10.15 in Linux. The complete suite used a native case-sensitive Linux filesystem rather than the macOS-backed bind mount.

  • /opt/ant/bin/ant -Dbase.path=/tomcat-build-libs -Dtest.entry=org.apache.tomcat.util.descriptor.tld.TestTldParser test
    • BUILD SUCCESSFUL; 7 tests, 0 failures, 0 errors, 0 skipped
  • /opt/ant/bin/ant -Dbase.path=/tomcat-build-libs -Dexecute.validate=true validate
    • BUILD SUCCESSFUL; Checkstyle 13.9.0 completed
  • /opt/ant/bin/ant -Dbase.path=/tomcat-build-libs clean deploy
    • BUILD SUCCESSFUL
  • /opt/ant/bin/ant -quiet -Dbase.path=/tomcat-build-libs test
    • BUILD SUCCESSFUL in 30m45s; 651 suites, 41,276 tests, 0 failures, 0 errors, 316 environment/feature skips
  • generated-distribution runtime smoke test
    • startup.sh started Tomcat; GET / returned HTTP 200; shutdown.sh stopped Tomcat and the recorded PID exited cleanly

@sainadh777

Copy link
Copy Markdown
Contributor Author

@markt-asf, could you please review this Jasper/TLD parsing change when you have a chance? I selected you because you recently maintained these exact paths and reviewed a comparable Jasper change. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant