NIHVIVO-2708 removed unnecessary iteration in getMainImageUri()
This commit is contained in:
parent
ef3affb349
commit
6f58b677cb
1 changed files with 7 additions and 7 deletions
|
@ -456,12 +456,12 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
if (this.mainImageUri != NOT_INITIALIZED) {
|
if (this.mainImageUri != NOT_INITIALIZED) {
|
||||||
return mainImageUri;
|
return mainImageUri;
|
||||||
} else {
|
} else {
|
||||||
for (ObjectPropertyStatement stmt : getObjectPropertyStatements()) {
|
List<ObjectPropertyStatement> mainImgStmts =
|
||||||
if (stmt.getPropertyURI()
|
getObjectPropertyStatements(VitroVocabulary.IND_MAIN_IMAGE);
|
||||||
.equals(VitroVocabulary.IND_MAIN_IMAGE)) {
|
if (mainImgStmts != null && mainImgStmts.size() > 0) {
|
||||||
mainImageUri = stmt.getObjectURI();
|
// arbitrarily return the first value in the list
|
||||||
return mainImageUri;
|
mainImageUri = mainImgStmts.get(0).getObjectURI();
|
||||||
}
|
return mainImageUri;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue