From 482b98e869d07802310e249d09d784c63f9a86b6 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 19 Sep 2014 15:40:50 +0200 Subject: 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. --- src/main/java/com/c2kernel/persistency/outcome/Viewpoint.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/c2kernel/persistency') diff --git a/src/main/java/com/c2kernel/persistency/outcome/Viewpoint.java b/src/main/java/com/c2kernel/persistency/outcome/Viewpoint.java index db7e8d7..fd2004b 100644 --- a/src/main/java/com/c2kernel/persistency/outcome/Viewpoint.java +++ b/src/main/java/com/c2kernel/persistency/outcome/Viewpoint.java @@ -1,11 +1,10 @@ package com.c2kernel.persistency.outcome; -import java.util.UUID; - import com.c2kernel.common.InvalidDataException; import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.C2KLocalObject; import com.c2kernel.events.Event; +import com.c2kernel.lookup.InvalidItemPathException; import com.c2kernel.lookup.ItemPath; import com.c2kernel.persistency.ClusterStorage; import com.c2kernel.persistency.ClusterStorageException; @@ -161,9 +160,9 @@ public class Viewpoint implements C2KLocalObject { this.itemPath = itemPath; } - public void setItemUUID( String uuid ) + public void setItemUUID( String uuid ) throws InvalidItemPathException { - setItemPath(new ItemPath(UUID.fromString(uuid))); + setItemPath(ItemPath.fromUUIDString(uuid)); } public String getItemUUID() { -- cgit v1.2.3