[MGNLMIGRATION-225] Extends creation now leaves empty nodes behind Created: 12/Feb/13 Updated: 08/Mar/13 Resolved: 08/Mar/13 |
|
| Status: | Closed |
| Project: | Migration 4.4 to 4.5 (closed) |
| Component/s: | Migration Task |
| Affects Version/s: | 1.2.1 |
| Fix Version/s: | 1.2.1 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Natascha Desmarais | Assignee: | Robert Šiška |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Template: |
|
||||
| Acceptance criteria: |
Empty
|
||||
| Date of First Response: | |||||
| Description |
|
The task that does the extends transformation and deletes redundant nodes now leaves empty nodes behind. Either it doesn't clean them up as previously or maybe it has something to do with recently fixed path issues regarding extends (if so, please link in this issue). The groovy/1.1.x version of this did a clean up of empty nodes at the end of an extends transformation. |
| Comments |
| Comment by Jan Haderka [ 15/Feb/13 ] |
+ boolean hasChildren = NodeUtil.asList(NodeUtil.getNodes(tmpNode, NodeUtil.EXCLUDE_META_DATA_FILTER)).size()<1?false:true; + boolean hasProperties = new JCRMgnlPropertiesFilteringNodeWrapper(tmpNode).getProperties().getSize()<1?false:true; Were you actually trying to obfuscate the code instead of fix the issue? Why are you using ternary statements to express simple boolean? Was it not boolean enough the first time? And since this is a regression, there should be a junit test for this change. |
| Comment by Samuel Schmitt [ 15/Feb/13 ] |
|
I dont understand why I obfuscate the code... and the issue is fixed. |
| Comment by Jan Haderka [ 15/Feb/13 ] |
|
You gotta be kidding me, right? You use the boolean statement to set the boolean value of boolean property. The result would be exactly the same without the ternary if you just negated the condition. And it would be easier to read. So, no ternaries are not forbidden, but in this case totally unnecessary. I know you don't like to think about it, but every line of code we write we have to also maintain, which means that sooner or later someone else would have to read it again and try to understand the intention. |
| Comment by Robert Šiška [ 08/Mar/13 ] |
|
test added |