Skip to content

Commit

Permalink
fix self reference when retreiving parents
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoh committed Jul 31, 2014
1 parent 491b0df commit de2d4a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion indexer/src/cz/incad/kramerius/indexer/FedoraOperations.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ public ArrayList<String> getParentsArray(String pid) {
if (rindex == null) {
rindex = ResourceIndexService.getResourceIndexImpl();
}
return rindex.getParentsPids(pid);
ArrayList<String> ret = rindex.getParentsPids(pid);

if(ret.contains(pid)){
logger.log(Level.WARNING, "Cyclic reference on {0}", pid);
ret.remove(pid);
}
return ret;

} catch (Exception ex) {
logger.log(Level.WARNING, ex.toString());
Expand Down

0 comments on commit de2d4a7

Please sign in to comment.