Skip to content

Wrap invalid XML IntMap keys as IOException - #3074

Open
adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2039-dominputcapsule
Open

adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2039-dominputcapsule

Conversation

@adrian-andrzjewski

Copy link
Copy Markdown

Summary

  • Convert malformed readIntSavableMap keys from NumberFormatException to IOException, preserving the parse exception as the cause.
  • Add an XML importer regression test for a non-integer map key.

Fixes #2039

Validation

  • :jme3-plugins:test --no-daemon --console=plain — all 47 tests passed.
  • The regression test failed against the original code with NumberFormatException, then passed with this change.

@adrian-andrzjewski

Copy link
Copy Markdown
Author

@stephengold Could you review this fix for #2039 when you have a chance? Thanks.

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for putting together this focused fix. The importer now translates malformed integer map keys into an IOException while retaining the original NumberFormatException as its cause, which gives callers the checked error they expect without losing useful parse details.

I also checked the regression test: it exercises the XML import path with a deliberately corrupted key and verifies both the exception type and cause, while leaving the shared binary map coverage untouched. The change is scoped to the affected XML reader and looks consistent with the surrounding importer error handling. Looks solid to me—thanks for addressing this!

@stephengold

Copy link
Copy Markdown
Member

@adrian-andrzjewski Sorry I'm not available to review this PR.

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.

DOMInputCapsule.readIntSavableMap does not check exceptions

3 participants