Hibernate SVN: r21018 - core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/timestamp.
by hibernate-commits@lists.jboss.org
Author: alessandrolt
Date: 2012-03-06 21:37:26 -0500 (Tue, 06 Mar 2012)
New Revision: 21018
Modified:
core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/timestamp/TimestampsRegionImpl.java
Log:
JBPAPP-5464 - the revision 17811 of BasicRegionAdapter (which is parent of TimestampsRegionImpl) added itself as cache listener by the line 102 (this.jbcCache.addCacheListener(this)) in its constructor. As TimestampsRegionImpl calls its parent construtor, the listener is initialized and the event "nodeModified" is called, but the localcache attribute was not initialized yet, so a NPE is throwed. A simple NULL check avoids that
Modified: core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/timestamp/TimestampsRegionImpl.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/timestamp/TimestampsRegionImpl.java 2012-03-06 09:47:44 UTC (rev 21017)
+++ core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/timestamp/TimestampsRegionImpl.java 2012-03-07 02:37:26 UTC (rev 21018)
@@ -160,7 +160,7 @@
Fqn fqn = event.getFqn();
Fqn regFqn = getRegionFqn();
- if (fqn.size() == regFqn.size() + 1 && fqn.isChildOf(regFqn)) {
+ if (localCache != null && fqn.size() == regFqn.size() + 1 && fqn.isChildOf(regFqn)) {
Object key = fqn.get(regFqn.size());
localCache.put(key, event.getData().get(ITEM));
}