You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/09/15 21:12:22 UTC
[PR] Fix PROPERTY_QSET indexing for types with several multi-name properties [poi-xmlbeans]
pjfanning opened a new pull request, #120:
URL: https://github.com/apache/poi-xmlbeans/pull/120
Supersedes #119 by @dwarven-cleric, keeping their commit and adding a regression test.
### Bug
In `SchemaTypeCodePrinter.printStaticFields` the `index` counter was declared inside the per-property loop, so it reset to zero on every iteration. Every property with more than one accepted QName (typically a substitution group head) was assigned `setSetIndex(0)`, and the generated impl class referenced `PROPERTY_QSET[0]` for all of them. When a type has two or more such properties, the second and later accessors silently matched the first property's element names.
This is a regression from the XMLBEANS-644 change (December 2023). It shipped in 5.2.1, 5.3.0, 5.4.0 and 5.4.1. Before that, the index came from a map whose size supplied the next slot, which was correct.
### Fix
Hoist `index` out of the loop (the one-line change from #119).
### Test
`PropertyQSetIndexTest` compiles an inline schema with two substitution groups referenced from one complex type, captures the generated sources with an in-memory `Filer`, and asserts that `getHeadAArray` uses `PROPERTY_QSET[0]` and `getHeadBArray` uses `PROPERTY_QSET[1]`. Verified the test fails on trunk without the fix and passes with it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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-unsubscribe@poi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [PR] Fix PROPERTY_QSET indexing for types with several multi-name properties [poi-xmlbeans]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #120:
URL: https://github.com/apache/poi-xmlbeans/pull/120
--
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-unsubscribe@poi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org