Author: chris.laprun(a)jboss.com
Date: 2010-04-02 13:37:38 -0400 (Fri, 02 Apr 2010)
New Revision: 2469
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
Log:
- GTNWSRP-17: Fixed implementation of update that wasn't respecting the method
contract (return the old id if it had changed).
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-04-02
13:00:21 UTC (rev 2468)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-04-02
17:37:38 UTC (rev 2469)
@@ -111,11 +111,14 @@
{
throw new IllegalArgumentException("Couldn't find ProducerInfoMapping
associated with key " + key);
}
+ String oldId = pim.getId();
+ String newId = producerInfo.getId();
pim.initFrom(producerInfo);
persister.closeSession(session, true);
- return null;
+ // if the consumer's id has changed, return the old one so that state can be
updated
+ return (oldId.equals(newId)) ? null : oldId;
}
@Override
Show replies by date