From b68ea0f2b12c4c5189c5fc7c182a1b242dc63579 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 3 Oct 2014 23:18:47 +0200 Subject: Rolled back the renaming of existing exceptions. --- src/main/java/com/c2kernel/collection/Aggregation.java | 16 ++++++++-------- .../com/c2kernel/collection/AggregationDescription.java | 8 ++++---- .../com/c2kernel/collection/AggregationInstance.java | 10 +++++----- .../java/com/c2kernel/collection/AggregationMember.java | 6 +++--- src/main/java/com/c2kernel/collection/Collection.java | 14 +++++++------- .../com/c2kernel/collection/CollectionDescription.java | 6 +++--- .../java/com/c2kernel/collection/CollectionMember.java | 6 +++--- src/main/java/com/c2kernel/collection/Dependency.java | 16 ++++++++-------- .../com/c2kernel/collection/DependencyDescription.java | 10 +++++----- .../java/com/c2kernel/collection/DependencyMember.java | 4 ++-- 10 files changed, 48 insertions(+), 48 deletions(-) (limited to 'src/main/java/com/c2kernel/collection') diff --git a/src/main/java/com/c2kernel/collection/Aggregation.java b/src/main/java/com/c2kernel/collection/Aggregation.java index b4d1b6b..ea1c182 100644 --- a/src/main/java/com/c2kernel/collection/Aggregation.java +++ b/src/main/java/com/c2kernel/collection/Aggregation.java @@ -21,8 +21,8 @@ package com.c2kernel.collection; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectAlreadyExists; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.graph.model.GraphModel; import com.c2kernel.graph.model.GraphPoint; import com.c2kernel.graph.model.TypeNameAndConstructionInfo; @@ -117,7 +117,7 @@ abstract public class Aggregation extends Collection } public AggregationMember addMember(ItemPath itemPath, CastorHashMap props, String classProps, GraphPoint location, int w, int h) - throws InvalidCollectionModification, ObjectAlreadyExists + throws InvalidCollectionModification, ObjectAlreadyExistsException { AggregationMember aggMem = addSlot(props, classProps, location, w, h); if (itemPath != null) { // some clients use this method when not setting a member @@ -130,7 +130,7 @@ abstract public class Aggregation extends Collection @Override - public AggregationMember addMember(ItemPath itemPath, CastorHashMap props, String classProps) throws InvalidCollectionModification, ObjectAlreadyExists + public AggregationMember addMember(ItemPath itemPath, CastorHashMap props, String classProps) throws InvalidCollectionModification, ObjectAlreadyExistsException { return addMember(itemPath, props, classProps, null, -1, -1); } @@ -139,7 +139,7 @@ abstract public class Aggregation extends Collection public AggregationMember addMember(CastorHashMap props, String classProps, GraphPoint location, int w, int h) throws InvalidCollectionModification { try { return addMember(null, props, classProps, location, w, h); - } catch (ObjectAlreadyExists e) { // not assigning an item so this won't happen + } catch (ObjectAlreadyExistsException e) { // not assigning an item so this won't happen return null; } } @@ -150,7 +150,7 @@ abstract public class Aggregation extends Collection } @Override - public void removeMember(int memberId) throws ObjectNotFound { + public void removeMember(int memberId) throws ObjectNotFoundException { for (AggregationMember element : mMembers.list) { if (element.getID() == memberId) { element.clearItem(); @@ -158,7 +158,7 @@ abstract public class Aggregation extends Collection return; } } - throw new ObjectNotFound("Member "+memberId+" not found"); + throw new ObjectNotFoundException("Member "+memberId+" not found"); } static public boolean getIsComposite(ItemPath itemPath, String name) @@ -167,7 +167,7 @@ abstract public class Aggregation extends Collection try { for(String collName: Gateway.getProxyManager().getProxy(itemPath).getContents(ClusterStorage.COLLECTION) ) if (name == null || name.equals(collName)) return true; - } catch (ObjectNotFound e) { + } catch (ObjectNotFoundException e) { return false; } return false; diff --git a/src/main/java/com/c2kernel/collection/AggregationDescription.java b/src/main/java/com/c2kernel/collection/AggregationDescription.java index 400a91d..a1f979d 100644 --- a/src/main/java/com/c2kernel/collection/AggregationDescription.java +++ b/src/main/java/com/c2kernel/collection/AggregationDescription.java @@ -27,8 +27,8 @@ package com.c2kernel.collection; */ import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectAlreadyExists; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.graph.model.Vertex; import com.c2kernel.property.PropertyDescriptionList; import com.c2kernel.property.PropertyUtility; @@ -48,7 +48,7 @@ public class AggregationDescription extends Aggregation implements CollectionDes } @Override - public Aggregation newInstance() throws ObjectNotFound + public Aggregation newInstance() throws ObjectNotFoundException { AggregationInstance newInstance = new AggregationInstance(getName()); //for each desc member @@ -65,7 +65,7 @@ public class AggregationDescription extends Aggregation implements CollectionDes Vertex v = getLayout().getVertexById(mem.getID()); newInstance.addMember(null, PropertyUtility.createProperty(pdList), pdList.getClassProps(),v.getCentrePoint(),v.getWidth(),v.getHeight()); } catch (InvalidCollectionModification e) { - } catch (ObjectAlreadyExists e) { } + } catch (ObjectAlreadyExistsException e) { } } else { diff --git a/src/main/java/com/c2kernel/collection/AggregationInstance.java b/src/main/java/com/c2kernel/collection/AggregationInstance.java index 2de6b7f..d2dbf7f 100644 --- a/src/main/java/com/c2kernel/collection/AggregationInstance.java +++ b/src/main/java/com/c2kernel/collection/AggregationInstance.java @@ -26,7 +26,7 @@ package com.c2kernel.collection; */ import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectAlreadyExists; +import com.c2kernel.common.ObjectAlreadyExistsException; import com.c2kernel.graph.model.GraphPoint; import com.c2kernel.lookup.ItemPath; import com.c2kernel.utils.CastorHashMap; @@ -47,20 +47,20 @@ public class AggregationInstance extends Aggregation @Override public AggregationMember addMember(ItemPath itemPath, CastorHashMap props, String classProps) - throws InvalidCollectionModification, ObjectAlreadyExists + throws InvalidCollectionModification, ObjectAlreadyExistsException { if( itemPath != null && exists(itemPath)) - throw new ObjectAlreadyExists(itemPath+" already exists in this collection."); + throw new ObjectAlreadyExistsException(itemPath+" already exists in this collection."); else return super.addMember(itemPath, props, classProps); } @Override public AggregationMember addMember(ItemPath itemPath, CastorHashMap props, String classProps, GraphPoint location, int w, int h) - throws InvalidCollectionModification, ObjectAlreadyExists + throws InvalidCollectionModification, ObjectAlreadyExistsException { if( itemPath != null && exists(itemPath)) - throw new ObjectAlreadyExists(itemPath+" already exists in this collection."); + throw new ObjectAlreadyExistsException(itemPath+" already exists in this collection."); else return super.addMember(itemPath, props, classProps, location, w, h); } diff --git a/src/main/java/com/c2kernel/collection/AggregationMember.java b/src/main/java/com/c2kernel/collection/AggregationMember.java index 4a5b8db..903914c 100644 --- a/src/main/java/com/c2kernel/collection/AggregationMember.java +++ b/src/main/java/com/c2kernel/collection/AggregationMember.java @@ -23,7 +23,7 @@ package com.c2kernel.collection; import java.util.StringTokenizer; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.proxy.ItemProxy; import com.c2kernel.graph.model.GraphableVertex; import com.c2kernel.lookup.InvalidItemPathException; @@ -129,7 +129,7 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb } @Override - public ItemProxy resolveItem() throws ObjectNotFound { + public ItemProxy resolveItem() throws ObjectNotFoundException { if (mItem == null && mItemPath != null) { mItem = Gateway.getProxyManager().getProxy(mItemPath); } @@ -142,7 +142,7 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb if (mItemPath != null) { try { mItemName = resolveItem().getName(); - } catch (ObjectNotFound ex) { + } catch (ObjectNotFoundException ex) { Logger.error(ex); mItemName = "Error ("+mItemPath+")"; } diff --git a/src/main/java/com/c2kernel/collection/Collection.java b/src/main/java/com/c2kernel/collection/Collection.java index fa0230b..7ab9fb2 100644 --- a/src/main/java/com/c2kernel/collection/Collection.java +++ b/src/main/java/com/c2kernel/collection/Collection.java @@ -23,8 +23,8 @@ package com.c2kernel.collection; import java.util.Iterator; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectAlreadyExists; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.C2KLocalObject; import com.c2kernel.graph.model.GraphModel; import com.c2kernel.lookup.ItemPath; @@ -155,12 +155,12 @@ abstract public class Collection implements C2KLocal return true; } - public E getMember(int memberId) throws ObjectNotFound { + public E getMember(int memberId) throws ObjectNotFoundException { for (E element : mMembers.list) { if (element.getID() == memberId) return element; } - throw new ObjectNotFound("Member "+memberId+" not found in "+mName); + throw new ObjectNotFoundException("Member "+memberId+" not found in "+mName); } public CollectionMemberList getMembers() @@ -168,9 +168,9 @@ abstract public class Collection implements C2KLocal return mMembers; } - public abstract E addMember(ItemPath itemPath, CastorHashMap props, String classProps) throws InvalidCollectionModification, ObjectAlreadyExists; + public abstract E addMember(ItemPath itemPath, CastorHashMap props, String classProps) throws InvalidCollectionModification, ObjectAlreadyExistsException; - public abstract void removeMember(int memberId) throws ObjectNotFound; + public abstract void removeMember(int memberId) throws ObjectNotFoundException; @Override public boolean equals(Object other) { @@ -183,7 +183,7 @@ abstract public class Collection implements C2KLocal E thisMem = i.next(); CollectionMember otherMem = otherColl.getMember(thisMem.getID()); if (!thisMem.equals(otherMem)) return false; - } catch (ObjectNotFound ex) { + } catch (ObjectNotFoundException ex) { return false; } } diff --git a/src/main/java/com/c2kernel/collection/CollectionDescription.java b/src/main/java/com/c2kernel/collection/CollectionDescription.java index 0c72b67..6f64abf 100644 --- a/src/main/java/com/c2kernel/collection/CollectionDescription.java +++ b/src/main/java/com/c2kernel/collection/CollectionDescription.java @@ -20,7 +20,7 @@ */ package com.c2kernel.collection; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.C2KLocalObject; /** @@ -33,8 +33,8 @@ public interface CollectionDescription extends C2KLo /** * Create a new instance of this collection. * @return a new collection instance - * @throws ObjectNotFound When an essential piece of description + * @throws ObjectNotFoundException When an essential piece of description * data, such as a child Item PropertyDescription outcome, doesn't exist. */ - public Collection newInstance() throws ObjectNotFound; + public Collection newInstance() throws ObjectNotFoundException; } diff --git a/src/main/java/com/c2kernel/collection/CollectionMember.java b/src/main/java/com/c2kernel/collection/CollectionMember.java index b7b9f31..3925435 100644 --- a/src/main/java/com/c2kernel/collection/CollectionMember.java +++ b/src/main/java/com/c2kernel/collection/CollectionMember.java @@ -21,7 +21,7 @@ package com.c2kernel.collection; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.proxy.ItemProxy; import com.c2kernel.lookup.ItemPath; import com.c2kernel.utils.CastorHashMap; @@ -70,9 +70,9 @@ public interface CollectionMember { /** * Resolve the Item currently assigned * @return the ItemProxy of the assigned Item - * @throws ObjectNotFound When empty + * @throws ObjectNotFoundException When empty */ - public ItemProxy resolveItem() throws ObjectNotFound; + public ItemProxy resolveItem() throws ObjectNotFoundException; /** * Get the integer slot ID, as generated by the parent Collection diff --git a/src/main/java/com/c2kernel/collection/Dependency.java b/src/main/java/com/c2kernel/collection/Dependency.java index cfcb4f7..1dd777c 100644 --- a/src/main/java/com/c2kernel/collection/Dependency.java +++ b/src/main/java/com/c2kernel/collection/Dependency.java @@ -22,8 +22,8 @@ package com.c2kernel.collection; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectAlreadyExists; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.lookup.ItemPath; import com.c2kernel.utils.CastorHashMap; import com.c2kernel.utils.KeyValuePair; @@ -84,8 +84,8 @@ public class Dependency extends Collection return mClassProps; } - public DependencyMember addMember(ItemPath itemPath) throws InvalidCollectionModification, ObjectAlreadyExists { - if (contains(itemPath)) throw new ObjectAlreadyExists("Item "+itemPath+" already exists in Dependency "+getName()); + public DependencyMember addMember(ItemPath itemPath) throws InvalidCollectionModification, ObjectAlreadyExistsException { + if (contains(itemPath)) throw new ObjectAlreadyExistsException("Item "+itemPath+" already exists in Dependency "+getName()); // create member object DependencyMember depMember = new DependencyMember(); depMember.setID(getCounter()); @@ -101,9 +101,9 @@ public class Dependency extends Collection @Override public DependencyMember addMember(ItemPath itemPath, CastorHashMap props, String classProps) - throws InvalidCollectionModification, ObjectAlreadyExists + throws InvalidCollectionModification, ObjectAlreadyExistsException { - if (contains(itemPath)) throw new ObjectAlreadyExists("Item "+itemPath+" already exists in Dependency "+getName()); + if (contains(itemPath)) throw new ObjectAlreadyExistsException("Item "+itemPath+" already exists in Dependency "+getName()); if (classProps != null && !classProps.equals(mClassProps)) throw new InvalidCollectionModification("Cannot change classProps in dependency member"); DependencyMember depMember = new DependencyMember(); @@ -133,14 +133,14 @@ public class Dependency extends Collection } @Override - public void removeMember(int memberId) throws ObjectNotFound { + public void removeMember(int memberId) throws ObjectNotFoundException { for (DependencyMember element : mMembers.list) { if (element.getID() == memberId) { mMembers.list.remove(element); return; } } - throw new ObjectNotFound("Member "+memberId+" not found"); + throw new ObjectNotFoundException("Member "+memberId+" not found"); } } diff --git a/src/main/java/com/c2kernel/collection/DependencyDescription.java b/src/main/java/com/c2kernel/collection/DependencyDescription.java index aff2aca..d49b505 100644 --- a/src/main/java/com/c2kernel/collection/DependencyDescription.java +++ b/src/main/java/com/c2kernel/collection/DependencyDescription.java @@ -21,8 +21,8 @@ package com.c2kernel.collection; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectAlreadyExists; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.lookup.ItemPath; import com.c2kernel.property.PropertyDescriptionList; import com.c2kernel.property.PropertyUtility; @@ -41,7 +41,7 @@ public class DependencyDescription extends Dependency implements CollectionDescr } @Override - public Collection newInstance() throws ObjectNotFound{ + public Collection newInstance() throws ObjectNotFoundException{ String depName = getName().replaceFirst("\'$", ""); // HACK: Knock the special 'prime' off the end for the case of descriptions of descriptions Dependency newDep = new Dependency(depName); if (mMembers.list.size() == 1) { // constrain the members based on the property description @@ -58,14 +58,14 @@ public class DependencyDescription extends Dependency implements CollectionDescr @Override - public DependencyMember addMember(ItemPath itemPath) throws InvalidCollectionModification, ObjectAlreadyExists { + public DependencyMember addMember(ItemPath itemPath) throws InvalidCollectionModification, ObjectAlreadyExistsException { checkMembership(); return super.addMember(itemPath); } @Override public DependencyMember addMember(ItemPath itemPath, CastorHashMap props, String classProps) - throws InvalidCollectionModification, ObjectAlreadyExists { + throws InvalidCollectionModification, ObjectAlreadyExistsException { checkMembership(); return super.addMember(itemPath, props, classProps); } diff --git a/src/main/java/com/c2kernel/collection/DependencyMember.java b/src/main/java/com/c2kernel/collection/DependencyMember.java index 502894f..dbb79e3 100644 --- a/src/main/java/com/c2kernel/collection/DependencyMember.java +++ b/src/main/java/com/c2kernel/collection/DependencyMember.java @@ -23,7 +23,7 @@ package com.c2kernel.collection; import java.util.StringTokenizer; import com.c2kernel.common.InvalidCollectionModification; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.proxy.ItemProxy; import com.c2kernel.lookup.InvalidItemPathException; import com.c2kernel.lookup.ItemPath; @@ -144,7 +144,7 @@ public class DependencyMember implements CollectionMember } @Override - public ItemProxy resolveItem() throws ObjectNotFound { + public ItemProxy resolveItem() throws ObjectNotFoundException { if (mItem == null && mItemPath != null) mItem = Gateway.getProxyManager().getProxy(mItemPath); return mItem; -- cgit v1.2.3