Skip to content

Fix MatParam.toString() when J3M formatting is unavailable (#2523) - #3072

Open
adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2523-matparam-tostring
Open

adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2523-matparam-tostring

Conversation

@adrian-andrzjewski

@adrian-andrzjewski adrian-andrzjewski commented Nov 13, 2026 •

Copy link
Copy Markdown

Summary

  • Preserve existing J3M-compatible output when getValueAsString supports the type.
  • Fall back to the actual value when J3M formatting is unavailable, including readable primitive and object array contents.
  • Add regression coverage for matrices, arrays, supported formatting, and null values.

Fixes #2523

Validation

  • Full core test suite: gradlew.bat :jme3-core:test (passed).
  • Checkstyle: gradlew.bat :jme3-core:checkstyleMain :jme3-core:checkstyleTest (both passed; existing warnings are in unrelated files).

@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 addressing this—this is a focused fix for a frustrating debugging case, and the fallback keeps MatParam.toString() useful for values that cannot be represented in J3M syntax.

I reviewed the implementation and regression tests. Preserving getValueAsString() whenever it returns a supported format avoids changing existing output, while the array-specific formatting makes unsupported array values readable instead of exposing Java’s type-and-identity strings. The tests cover matrices, primitive and object arrays, supported vector formatting, and null values, which exercises the important behavior boundaries here.

Looks good to me. Thanks for adding the regression coverage alongside the fix!

@adrian-andrzjewski

Copy link
Copy Markdown
Author

@yaRnMcDonuts Could you review this focused fix for #2523? It preserves J3M formatting where supported and reports matrix and array values when it is not. I validated it with the full jme3-core test suite and Checkstyle.

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.

MatParam: Design Flaw: getValueAsString() returning null leads to misleading output in toString()

2 participants