[MAGNOLIA-4141] jcr: add initilization method for wrapper cloning Created: 17/Oct/11 Updated: 22/Mar/12 Resolved: 30/Dec/11 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | None |
| Fix Version/s: | 4.5 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Tobias Mattsson | Assignee: | Tobias Mattsson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| 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 |
|
We clone Node wrappers both in DelegateNodeWrapper.deepUnwrap() and in ChildWrappingNodeWrapper.wrapNode(). In both instances we simply change the wrapped node and trust the subclass to do additional setup as required. However changing the wrapped node directly can be problematic depending on what the subclass wants to do. For instance, LazyNodeWrapper keeps its node reference locally in a field so this doesn't get updated during cloning. DelegateNodeWrapper should have a method: protected void initClone(Node newNode)
or similar to allow subclasses to act appropriately on cloning. |