Changing IndividualSDB.getMoniker() to return empty string and never null. NIHVIVO-2061
This commit is contained in:
parent
a3345f4c53
commit
b78d6ed883
1 changed files with 6 additions and 42 deletions
|
@ -587,48 +587,12 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
moniker = webappDaoFactory.getJenaBaseDao()
|
moniker = webappDaoFactory.getJenaBaseDao()
|
||||||
.getPropertyStringValue(
|
.getPropertyStringValue(
|
||||||
ind,webappDaoFactory.getJenaBaseDao().MONIKER);
|
ind,webappDaoFactory.getJenaBaseDao().MONIKER);
|
||||||
//Changing behavior to moniker because it is taking extra time to get the vclass
|
if (moniker == null) {
|
||||||
//alternative if the moniker isn't filled out. That time is wasted if the vclass alternative isn't desired.
|
//Changing behavior to moniker because it is taking extra time to get the vclass
|
||||||
//see NIHVIVO-2001
|
//alternative if the moniker isn't filled out. That time is wasted if the vclass alternative isn't desired.
|
||||||
// if (moniker == null) {
|
//see NIHVIVO-2001
|
||||||
// try {
|
moniker = "";
|
||||||
// // trying to deal with the fact that an entity
|
}
|
||||||
// // may have more than 1 VClass
|
|
||||||
// List<VClass> clasList = this.getVClasses(true);
|
|
||||||
// if (clasList == null || clasList.size() < 2) {
|
|
||||||
// if( getVClass() != null )
|
|
||||||
// moniker = getVClass().getName();
|
|
||||||
// } else {
|
|
||||||
// VClass preferredClass = null;
|
|
||||||
// for (VClass clas : clasList) {
|
|
||||||
// if (clas.getCustomDisplayView() != null
|
|
||||||
// && clas.getCustomDisplayView()
|
|
||||||
// .length()>0) {
|
|
||||||
// // arbitrarily deciding that the
|
|
||||||
// // preferred class (could be >1)
|
|
||||||
// // is one with a custom view
|
|
||||||
// preferredClass = clas;
|
|
||||||
// log.debug("Found direct class [" +
|
|
||||||
// clas.getName() +
|
|
||||||
// "] with custom view " +
|
|
||||||
// clas.getCustomDisplayView() +
|
|
||||||
// "; resetting entity vClass " +
|
|
||||||
// "to this class");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (preferredClass == null) {
|
|
||||||
// // no basis for selecting a preferred
|
|
||||||
// // class name to use
|
|
||||||
// moniker = null;
|
|
||||||
// // was this.getVClass().getName();
|
|
||||||
// } else {
|
|
||||||
// preferredClass.getName();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error(e,e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return moniker;
|
return moniker;
|
||||||
} finally {
|
} finally {
|
||||||
ind.getOntModel().leaveCriticalSection();
|
ind.getOntModel().leaveCriticalSection();
|
||||||
|
|
Loading…
Add table
Reference in a new issue