[MAGNOLIA-6191] Map2Bean should support empty files/nodes Created: 04/May/15  Updated: 08/May/15  Resolved: 04/May/15

Status: Closed
Project: Magnolia
Component/s: configuration
Affects Version/s: 5.4
Fix Version/s: 5.4

Type: Bug Priority: Major
Reporter: Mikaël Geljić Assignee: Mikaël Geljić
Resolution: Fixed Votes: 0
Labels: m2b, map2bean
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

When Jimmy creates a new empty file on the file system, or a new resource in JCR (no text property nor binary node yet), Map2BeanTransformer currently explicitly throws an NPE.
This should not be considered an invalid behavior, we don't want Jimmy to get puzzled at that cryptic stack trace.

YamlReader currently reads null out of such empty file/node, but regardless of where the map comes from, Map2Bean should be supportive, and eventually treat null as an empty map (which actually works).


Generated at Mon Feb 12 04:12:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.