Agreed that this is hacky, but either option is an implementation detail that can be
changed. The hack should be simple and allows us to avoid adding a behavior change vs 1.x
in 2.0. We can then look at non-hacky approaches at greater leisure. If we don't
restore the 1.x behavior in 2.0, we really shouldn't restore it at all.
Here's the hack impl. I haven't tried this; only quality guarantee I can give is
that Eclipse doesn't give me any compile error warnings:
| Index: RegionManager.java
| ===================================================================
| RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RegionManager.java,v
| retrieving revision 1.38
| diff -u -r1.38 RegionManager.java
| --- RegionManager.java 28 Jun 2007 16:53:35 -0000 1.38
| +++ RegionManager.java 26 Jul 2007 16:08:42 -0000
| @@ -139,6 +139,8 @@
| {
| Fqn fqnToUse = fqn;
| if (DEFAULT_REGION.equals(fqnToUse)) fqnToUse = Fqn.ROOT;
| +
| + Region firstFound = null;
| // first see if a region for this specific Fqn exists
| if (regionsRegistry.containsKey(fqnToUse))
| {
| @@ -152,6 +154,12 @@
| {
| return r;
| }
| +
| + if (type == Region.Type.MARSHALLING)
| + {
| + firstFound = r;
| + }
| +
| }
|
| // if not, attempt to create one ...
| @@ -195,11 +203,16 @@
| {
| nextBestThing = r;
| }
| +
| + if (type == Region.Type.MARSHALLING && firstFound == null)
| + {
| + firstFound = r;
| + }
| }
| if (nextFqn.isRoot()) break;
| }
|
| - return nextBestThing;
| + return (nextBestThing == null ? firstFound : nextBestThing);
| }
|
| /**
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067901#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...