diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-09-19 15:40:50 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-09-19 15:40:50 +0200 |
| commit | 482b98e869d07802310e249d09d784c63f9a86b6 (patch) | |
| tree | bd6c55d5d5ebf967fb22b5cf1ceb9f3f6a7bbdd9 /src/main/java/com/c2kernel/entity/imports | |
| parent | 3743d182d99dbed9d2be84dc357f6839ffe4d2ec (diff) | |
Introduced static method ItemPath.fromUUIDString and made the UUID
constructor protected to better handle ItemPath and AgentPath
construction with String UUIDs, throwing the right exceptions.
Diffstat (limited to 'src/main/java/com/c2kernel/entity/imports')
| -rw-r--r-- | src/main/java/com/c2kernel/entity/imports/ImportAggregation.java | 10 | ||||
| -rw-r--r-- | src/main/java/com/c2kernel/entity/imports/ImportDependency.java | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java b/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java index 2f19452..2d8f0a2 100644 --- a/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java +++ b/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java @@ -1,12 +1,12 @@ package com.c2kernel.entity.imports;
import java.util.ArrayList;
-import java.util.UUID;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.graph.model.GraphPoint;
import com.c2kernel.lookup.DomainPath;
+import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.property.PropertyDescription;
import com.c2kernel.property.PropertyDescriptionList;
@@ -36,8 +36,8 @@ public class ImportAggregation implements java.io.Serializable { if (thisMem.itemDescriptionPath != null && thisMem.itemDescriptionPath.length()>0) {
ItemPath itemPath;
try {
- itemPath = new ItemPath(UUID.fromString(thisMem.itemDescriptionPath));
- } catch (IllegalArgumentException ex) {
+ itemPath = ItemPath.fromUUIDString(thisMem.itemDescriptionPath);
+ } catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemDescriptionPath).getItemPath();
}
PropertyDescriptionList propList = PropertyUtility.getPropertyDescriptionOutcome(itemPath);
@@ -50,8 +50,8 @@ public class ImportAggregation implements java.io.Serializable { if (thisMem.itemPath != null && thisMem.itemPath.length()>0) {
ItemPath itemPath;
try {
- itemPath = new ItemPath(UUID.fromString(thisMem.itemPath));
- } catch (IllegalArgumentException ex) {
+ itemPath = ItemPath.fromUUIDString(thisMem.itemPath);
+ } catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemPath).getItemPath();
}
if (itemPath == null)
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java index a43f6e3..87e6b11 100644 --- a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java +++ b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java @@ -1,11 +1,11 @@ package com.c2kernel.entity.imports;
import java.util.ArrayList;
-import java.util.UUID;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.lookup.DomainPath;
+import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.property.PropertyDescription;
import com.c2kernel.property.PropertyDescriptionList;
@@ -58,8 +58,8 @@ public class ImportDependency implements java.io.Serializable { for (ImportDependencyMember thisMem : dependencyMemberList) {
ItemPath itemPath;
try {
- itemPath = new ItemPath(UUID.fromString(thisMem.itemPath));
- } catch (IllegalArgumentException ex) {
+ itemPath = ItemPath.fromUUIDString(thisMem.itemPath);
+ } catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemPath).getItemPath();
}
|
