diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-02-27 21:36:23 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-03-18 14:03:54 +0100 |
| commit | c6204281c819ea4514952ed7623e282babcb5f8c (patch) | |
| tree | c15b27b53f1967b062f219c401f28d46e5fdd654 /src/main/java/com/c2kernel/entity/proxy/AgentProxy.java | |
| parent | 6e35118970c7af70eb0ac938859d794f7348d367 (diff) | |
Morelookup
Diffstat (limited to 'src/main/java/com/c2kernel/entity/proxy/AgentProxy.java')
| -rw-r--r-- | src/main/java/com/c2kernel/entity/proxy/AgentProxy.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/c2kernel/entity/proxy/AgentProxy.java b/src/main/java/com/c2kernel/entity/proxy/AgentProxy.java index 6d2b17d..18b8ae8 100644 --- a/src/main/java/com/c2kernel/entity/proxy/AgentProxy.java +++ b/src/main/java/com/c2kernel/entity/proxy/AgentProxy.java @@ -11,7 +11,7 @@ package com.c2kernel.entity.proxy;
import java.util.Date;
-import java.util.Enumeration;
+import java.util.Iterator;
import com.c2kernel.common.AccessRightsException;
import com.c2kernel.common.InvalidDataException;
@@ -257,14 +257,14 @@ public class AgentProxy extends EntityProxy /** Let scripts resolve items */
public ItemProxy searchItem(String name) throws ObjectNotFoundException {
- Enumeration<Path> results = Gateway.getLookup().search(new DomainPath(""),name);
+ Iterator<Path> results = Gateway.getLookup().search(new DomainPath(""),name);
Path returnPath = null;
- if (!results.hasMoreElements())
+ if (!results.hasNext())
throw new ObjectNotFoundException(name, "");
- while(results.hasMoreElements()) {
- Path nextMatch = results.nextElement();
+ while(results.hasNext()) {
+ Path nextMatch = results.next();
if (returnPath != null && nextMatch.getSysKey() != -1 && returnPath.getSysKey() != nextMatch.getSysKey())
throw new ObjectNotFoundException("Too many items with that name");
returnPath = nextMatch;
|
