Skip to content

Moving iterator declaration out of "for" loop. - #119

Closed
dwarven-cleric wants to merge 1 commit into
apache:trunkfrom
dwarven-cleric:patch-1
Closed

dwarven-cleric wants to merge 1 commit into
apache:trunkfrom
dwarven-cleric:patch-1

Conversation

@dwarven-cleric

Copy link
Copy Markdown
Contributor

While this iterator is within the loop, all generated references to PROPERTY_QSET[] will point to index 0 instead of being incremented.

While this iterator is within the loop, all generated references to
PROPERTY_QSET[] will point to index 0 instead of being incremented.
@pjfanning

Copy link
Copy Markdown
Member

Can you provide a POC that shows the issue? I don't think this is a new issue. If it is a new bug then we should cancel the 5.4.1 release.

@dwarven-cleric

dwarven-cleric commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Sure! I've been trying to generate Java for NIEM 2.0. Using XMLBeans 5.4.0, the plugin generated
StructuredAddressTypeImpl.java. Notice that on line 476, it says "return getXmlObjectArray(PROPERTY_QSET[0], new org.apache.xmlbeans.XmlObject[0]);" The PROPERTY_QSET index should be 1 at this line.

Please let me know if you need a more thorough example.

@pjfanning

Copy link
Copy Markdown
Member

Claude AI think #10 is at fault - that was added in release 5.2.1.

We'll still need a regression test for this.

@pjfanning

Copy link
Copy Markdown
Member

Claude generated a test - see #120

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.

2 participants