diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-09-09 12:14:01 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-09-09 12:14:01 +0200 |
| commit | 8e5d28aec9368c29acec858e9d748ed2ed5eb397 (patch) | |
| tree | f80282cb0c9ab47159816ca3c3a8f7c193103e65 /src/main/java/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java | |
| parent | 7690395f52e3d0853695cea77f0103fb56c81838 (diff) | |
Support move to using UUIDs and ItemPaths as Item identifiers instead of
ints.
Diffstat (limited to 'src/main/java/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java')
| -rw-r--r-- | src/main/java/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java b/src/main/java/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java index a2e43f0..bfb81e8 100644 --- a/src/main/java/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java +++ b/src/main/java/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java @@ -4,6 +4,7 @@ import java.awt.HeadlessException; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
+import java.util.UUID;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
@@ -19,7 +20,6 @@ import com.c2kernel.entity.proxy.ProxyObserver; import com.c2kernel.events.Event;
import com.c2kernel.gui.MainFrame;
import com.c2kernel.lifecycle.instance.predefined.PredefinedStep;
-import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.outcome.Outcome;
@@ -96,13 +96,11 @@ public class CollectionHistoryWindow extends JFrame { return "Click to view";
String name;
try {
- ItemProxy childItem = Gateway.getProxyManager().getProxy(new ItemPath(Integer.parseInt(((String[])collEventData.get(rowIndex))[2])));
+ ItemProxy childItem = Gateway.getProxyManager().getProxy(new ItemPath(UUID.fromString(((String[])collEventData.get(rowIndex))[2])));
name = childItem.getName();
- } catch (NumberFormatException e) {
- name = "Invalid Item key: "+((String[])collEventData.get(rowIndex))[2];
} catch (ObjectNotFoundException e) {
name = "Item deleted: "+((String[])collEventData.get(rowIndex))[2];
- } catch (InvalidItemPathException e) {
+ } catch (IllegalArgumentException e) {
name = "Invalid Item key: "+((String[])collEventData.get(rowIndex))[2];
}
return name;
@@ -169,7 +167,7 @@ public class CollectionHistoryWindow extends JFrame { else {
String[] params = (String[])data;
try {
- ItemProxy childItem = Gateway.getProxyManager().getProxy(new ItemPath(Integer.parseInt(params[2])));
+ ItemProxy childItem = Gateway.getProxyManager().getProxy(new ItemPath(UUID.fromString(params[2])));
MainFrame.itemFinder.pushNewKey(childItem.getName());
} catch (Exception ex) { }
}
|
