这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@leewyatt
Copy link
Collaborator

@leewyatt leewyatt commented Feb 3, 2025

Issue

Previously, SimpleStringConverter had an issue where nullDefaultValue was not applied correctly.
This happened because the toString(T object) method explicitly returned "" when the object was null,
bypassing the intended handling in the constructor.

Fix

  • Now, toString(T object) always calls valueToStringCallback.call(object), ensuring the logic set
    in the constructor (including nullDefaultValue) is properly applied.
  • Updated the default constructor to safely handle null values without causing NullPointerException.
  • Improved documentation for better clarity.

Impact

  • Any existing usage where null handling depended on nullDefaultValue should now work as expected.
  • No breaking changes, but behavior for null values will now respect the provided nullDefaultValue.

- Fixed an issue where nullDefaultValue was not applied due to an override in toString().
- Now, toString() always delegates to the valueToStringCallback, allowing proper null handling.
- Updated the default constructor to safely handle null values.

Updated SimpleStringConverter with a clearer default null handling and refined its callback logic. Enhanced the demo by adding a status ComboBox, demonstrating enum handling and the use of converters for better formatting.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@dlemmermann dlemmermann merged commit 8f26a09 into master Feb 3, 2025
3 of 4 checks passed
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.

3 participants