Skip to content

Conversation

@marko-kriskovic
Copy link
Owner

Summary

  • Fixed the inverted null check condition in JsonMapConverter.mapToJson() method
  • Changed if (map != null) to if (map == null) on line 40

Problem

The method was throwing an IllegalArgumentException when a valid (non-null) map was passed, and would only proceed with null maps, which is the opposite of the intended behavior.

Solution

Corrected the null check logic to properly validate that the input map is not null before processing.

Test Results

All tests in JsonMapConverterTest now pass:

  • testMapToJson_SimpleMap()
  • testMapToJson_NestedMap()
  • testMapToJson_EmptyMap()
  • testMapToJson_NullInput()
  • testRoundTrip_JsonToMapToJson()

Fixes #1

🤖 Generated with Claude Code

Changed the condition from 'if (map != null)' to 'if (map == null)' to properly validate null input. The previous logic was throwing an exception when the map was valid, causing all tests to fail.

Fixes #1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

Padaju testovi

2 participants