Issue Details (XML | Word | Printable)

Key: PTOYS-8
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Joerg Schaible
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ProxyToys

Delegation fails in recursion

Created: 23/Feb/05 04:12 PM   Updated: 23/Feb/05 05:01 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
The delegating invoker fails for indirect recursive calls as they might easily occur in a CoR pattern.

Test case:

public static interface Faculty { int calc(int i, Faculty fac); };

public void testShouldSupportIndirectRecursion() {
Faculty fac = new Faculty() {
public int calc(int i, Faculty fac) { return i == 1 ? 1 : i * fac.calc(i-1, fac); }
};
Faculty proxy = (Faculty)Delegating.object(Faculty.class, fac, getFactory());
assertEquals(120, fac.calc(5, fac));
assertEquals(120, proxy.calc(5, proxy));
}

Issue is related to PTOYS-5



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Joerg Schaible added a comment - 23/Feb/05 05:01 PM
Done. Removed cycle check in DelegatingInvoker completly. Had to implement an alternative cycle check for HotSwapInvoker.