This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This is from HFSJ book. Chapter no:5,page:218. They have written that "the getValue() method returns the OLD value of the attribute if the attribute was replaced." But here old value is "b" for "a". So why it is returning "c"?"c" is the new value. Anybody can explain?
The API for ServletRequestAttributeEvent#getValue is clear about that : Returns the value of the attribute that has been added, removed or replaced. If the attribute was added (or bound), this is the value of the attribute. If the attribute was removed (or unbound), this is the value of the removed attribute. If the attribute was replaced, this is the old value of the attribute.
They have written that "the getValue() method returns the OLD value of the attribute if the attribute was replaced
What did you get after : "P:" ? (which is your replace method)
You should have : A:a->b (set a to b) P:a->b (replace a by c, so the old value b is printed) M:a->c (remove a)