[MAGNOLIA-6364] Map2Bean doesn't fail with wrong generic type Created: 07/Sep/15 Updated: 15/Apr/16 Resolved: 23/Sep/15 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 5.4.1 |
| Fix Version/s: | 5.4.3 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Christoph Meier | Assignee: | Trang Truong |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 10d 7.5h | ||
| Original Estimate: | 4.5h | ||
| Issue Links: |
|
||||||||||||||||||||
| 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
|
||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||
| Sprint: | Basel 12 | ||||||||||||||||||||
| Story Points: | 8 | ||||||||||||||||||||
| Description |
|
Given the following *wrong* YAML fragment for a sample AvailabilityDefinition: availability:
nodeTypes:
- mgnl-folder: mgnl:folder
* The above is wrong because nodeTypes expects a list of strings, not maps. When Map2BeanTransformer processes the "erroneous" YAML, It wrongly creates a collection containing maps, regardless of the generic type in the bean method signature. Map2Bean should ignore entries which don't match the bean method's generic type, and warn accordingly. See also AvailabilityDefinition.java
Collection<String> getNodeTypes()
availability:
nodeTypes:
- mgnl:product
|
| Comments |
| Comment by Mikaël Geljić [ 09/Sep/15 ] |
|
FYI I eventually wrote a test-case demonstrating this issue. See branch bugfix/ |
| Comment by Trang Truong [ 22/Sep/15 ] |
|
mgeljic I investigated for the case of Correct YAML fragment and come up with 2 approaches
Please could you give me advice on it? I committed my implementation to your above branch. |
| Comment by Aleksandr Pchelintcev [ 22/Sep/15 ] |
|
Anyway - I'm open for the discussion tmr, maybe I'm missing something. |