aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-03-15 10:08:21 (EDT)
committerGlyn Normington2011-03-15 10:08:21 (EDT)
commit2629bdc7dbaf397dc3399ee30349f2c2a6c43630 (patch)
tree1ba64ce3095c8f6441b1b99518194210a3e8f82c
parentc40c69861d363dbbe471550f555637f611511493 (diff)
downloadorg.eclipse.virgo.kernel-2629bdc7dbaf397dc3399ee30349f2c2a6c43630.zip
org.eclipse.virgo.kernel-2629bdc7dbaf397dc3399ee30349f2c2a6c43630.tar.gz
org.eclipse.virgo.kernel-2629bdc7dbaf397dc3399ee30349f2c2a6c43630.tar.bz2
Add checks for non-exist regions in edges.
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraphPersistence.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraphPersistence.java b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraphPersistence.java
index 85355b6..13709f1 100644
--- a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraphPersistence.java
+++ b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraphPersistence.java
@@ -168,9 +168,15 @@ final class StandardRegionDigraphPersistence implements RegionDigraphPersistence
private static void readEdge(DataInputStream in, RegionDigraph digraph) throws IOException, InvalidSyntaxException, BundleException {
// read tail region name
- Region tail = digraph.getRegion(in.readUTF());
+ String tailName = in.readUTF();
+ Region tail = digraph.getRegion(tailName);
+ if (tail == null)
+ throw new IOException("Could not find tail reagion: " + tailName);
// read head region name
- Region head = digraph.getRegion(in.readUTF());
+ String headName = in.readUTF();
+ Region head = digraph.getRegion(headName);
+ if (head == null)
+ throw new IOException("Could not find head reagion: " + headName);
// read the sharing policy
RegionFilterBuilder builder = digraph.createRegionFilterBuilder();
// read the number of name spaces