diff --git a/Goobi/src/de/sub/goobi/metadaten/copier/MetadataPathSelector.java b/Goobi/src/de/sub/goobi/metadaten/copier/MetadataPathSelector.java index 872c0ba84cd..4ad8d41fa07 100644 --- a/Goobi/src/de/sub/goobi/metadaten/copier/MetadataPathSelector.java +++ b/Goobi/src/de/sub/goobi/metadaten/copier/MetadataPathSelector.java @@ -349,26 +349,21 @@ private DocStruct getSubnode(DocStruct logicalNode) { if (index == null || index.equals(0) || index.equals(Integer.MAX_VALUE)) { return children.get(0); } - default: - if (index == null) { - throw new RuntimeException("Could not resolve metadata path: Path selector is ambiguous for " - + docStructType); - } else { - if (!(index instanceof Integer)) { - throw new RuntimeException("Could not resolve metadata path: In this regard, index \"" + index - + "\" is not allowed."); - } else { - if (index.equals(Long.MAX_VALUE)) { - return children.get(children.size() - 1); - } - if (children.size() >= ((Integer) index).intValue()) { - return children.get(((Integer) index).intValue()); - } else { - return null; - } - } - } } + + if (index == null) { + throw new RuntimeException("Could not resolve metadata path: Path selector is ambiguous for " + + docStructType); + } else if (!(index instanceof Integer)) { + throw new RuntimeException("Could not resolve metadata path: In this regard, index \"" + + index + "\" is not allowed."); + } else if (index.equals(Long.MAX_VALUE)) { + return children.get(children.size() - 1); + } else if (children.size() >= ((Integer) index).intValue()) { + return children.get(((Integer) index).intValue()); + } + + return null; } /**