//#4311
@Override
public String getCollectorTitleCache() {
- if (protectedCollectorTitleCache){
+ if (protectedCollectorTitleCache == PROTECTED){
return this.collectorTitleCache;
+ }
+ if (collectorTitleCache == null){
+ this.collectorTitleCache = getCacheStrategy().getCollectorTitleCache(this);
}else{
- return super.getCollectorTitleCache();
+ //as long as team members do not inform the team about changes the cache must be created new each time
+ collectorTitleCache = getCacheStrategy().getCollectorTitleCache(this);
}
+ return collectorTitleCache;
}
/**
if (StringUtils.isNotBlank(person.getNomenclaturalTitle())){
team.setNomenclaturalTitleCache(person.getNomenclaturalTitle(), true); //sets the protected flag always to true, this is necessary as long as person does not have a nomenclatural title cache; maybe setting the protected title itself is not necessary but does no harm
}
+ if (StringUtils.isNotBlank(person.getCollectorTitle())){
+ team.setCollectorTitleCache(person.getCollectorTitle(), true); //sets the protected flag always to true, this is necessary as long as person does not have a collector title cache; maybe setting the protected title itself is not necessary but does no harm
+ }
if (! genericDao.isMergeable(team, person, strategy)){
throw new MergeException("Person can not be transformed into team.");
Assert.assertEquals("If person was completely empty we don't expect the title cache to be taken from person.nomenclaturalTitle", TeamDefaultCacheStrategy.EMPTY_TEAM, team.getTitleCache());
Assert.assertFalse("If person was completely empty we don't expect the title cache to be protected", team.isProtectedTitleCache());
Assert.assertEquals("If person was completely empty we expect nom. title to be the empty team constant", TeamDefaultCacheStrategy.EMPTY_TEAM, team.getNomenclaturalTitleCache());
+ Assert.assertEquals("If person was completely empty we expect collector title to be the empty team constant", TeamDefaultCacheStrategy.EMPTY_TEAM, team.getCollectorTitleCache());
try{
service.convertPerson2Team(person2.getUuid());