Added check.key.duplicates.in.keyref parameter (default = no); if set… #4617
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… to yes then key duplication is checked for in keyref processing instead of at the beginning
Description
A parameter was added that allows key duplication to be checked for after filtering (in keyref target [preprocess] and map-keyref [preprocess2] to be exact). The parameter is check.key.duplicates.in.keyref and it defaults to "no" which means that by default the current behavior doesn't change. To change it the parameter must be explicitly set to "yes".
Motivation and Context
The key duplication currently reports keys as duplicated even when the duplicates are filtered out in filtering stage. One of our clients is having problems because of that as for them a key duplication warning is fatal and they quit the processing if that warning is logged.
How Has This Been Tested?
The test suite was executed with gradlew check. One of the test cases failed, but after trying the original forked code it failed in the same test case; therefore, the failure is not due to the new code. The following test case fails in 4.3.1 HEAD (as forked a week ago) on my machine (Windows 11):
IntegrationTestPreprocess2 > testconref() FAILED
org.apache.tools.ant.BuildException at ExtensibleAntInvoker.java:214
Caused by: org.dita.dost.exception.DITAOTException at CopyToModule.java:72
Caused by: org.dita.dost.exception.DITAOTException at AbstractStore.java:113
The change should be backward compatible and it has no impact on the output. It just potentially changes the log.
Type of Changes
Documentation and Compatibility
The change requires addition of a new parameter here: https://www.dita-ot.org/dev/parameters/parameters-base. The parameter was already added to org.dita.base/plugin.xml.
The change shouldn't affect backwards compatibility or other users' overrides.
Checklist