mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-16 07:10:48 +00:00
Merge branch 'master' into bug4509
Change-Id: Ia63ce5f964be5471b00a5429d6984e141d742b4d
This commit is contained in:
commit
22b4ec6535
46 files changed
+173
-154
No files matched your search
+1
-1
@@ -84,7 +84,7 @@ public interface SharedDomainFactory extends CompetitorFactory, BoatFactory {
|
||||
/**
|
||||
* Gets the {@link CompetitorAndBoatStore} of this {@link SharedDomainFactory}.
|
||||
*/
|
||||
CompetitorAndBoatStore getCompetitorStore();
|
||||
CompetitorAndBoatStore getCompetitorAndBoatStore();
|
||||
|
||||
/**
|
||||
* If a {@link CourseArea} with the given id already exists, it is returned. Otherwise a new {@link CourseArea}
|
||||
|
||||
Regular → Executable
+9
-9
@@ -333,23 +333,23 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompetitorAndBoatStore getCompetitorStore() {
|
||||
public CompetitorAndBoatStore getCompetitorAndBoatStore() {
|
||||
return competitorAndBoatStore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Competitor getExistingCompetitorById(Serializable competitorId) {
|
||||
return getCompetitorStore().getExistingCompetitorById(competitorId);
|
||||
return getCompetitorAndBoatStore().getExistingCompetitorById(competitorId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompetitorWithBoat getExistingCompetitorWithBoatById(Serializable competitorId) {
|
||||
return getCompetitorStore().getExistingCompetitorWithBoatById(competitorId);
|
||||
return getCompetitorAndBoatStore().getExistingCompetitorWithBoatById(competitorId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompetitorToUpdateDuringGetOrCreate(Competitor competitor) {
|
||||
return getCompetitorStore().isCompetitorToUpdateDuringGetOrCreate(competitor);
|
||||
return getCompetitorAndBoatStore().isCompetitorToUpdateDuringGetOrCreate(competitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -359,7 +359,7 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
|
||||
if (logger.isLoggable(Level.FINEST)) {
|
||||
logger.log(Level.FINEST, "getting or creating competitor "+name+" with ID "+competitorId+" in domain factory "+this);
|
||||
}
|
||||
return getCompetitorStore().getOrCreateCompetitor(competitorId, name, shortname, displayColor, email, flagImage, team,
|
||||
return getCompetitorAndBoatStore().getOrCreateCompetitor(competitorId, name, shortname, displayColor, email, flagImage, team,
|
||||
timeOnTimeFactor, timeOnDistanceAllowancePerNauticalMile, searchTag);
|
||||
}
|
||||
|
||||
@@ -370,23 +370,23 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
|
||||
if (logger.isLoggable(Level.FINEST)) {
|
||||
logger.log(Level.FINEST, "getting or creating competitor "+name+" with ID "+competitorId+" in domain factory "+this);
|
||||
}
|
||||
return getCompetitorStore().getOrCreateCompetitorWithBoat(competitorId, name, shortName, displayColor, email, flagImageURI, team,
|
||||
return getCompetitorAndBoatStore().getOrCreateCompetitorWithBoat(competitorId, name, shortName, displayColor, email, flagImageURI, team,
|
||||
timeOnTimeFactor, timeOnDistanceAllowancePerNauticalMile, searchTag, boat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicBoat getExistingBoatById(Serializable boatId) {
|
||||
return getCompetitorStore().getExistingBoatById(boatId);
|
||||
return getCompetitorAndBoatStore().getExistingBoatById(boatId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBoatToUpdateDuringGetOrCreate(Boat boat) {
|
||||
return getCompetitorStore().isBoatToUpdateDuringGetOrCreate(boat);
|
||||
return getCompetitorAndBoatStore().isBoatToUpdateDuringGetOrCreate(boat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicBoat getOrCreateBoat(Serializable id, String name, BoatClass boatClass, String sailId, Color color) {
|
||||
return getCompetitorStore().getOrCreateBoat(id, name, boatClass, sailId, color);
|
||||
return getCompetitorAndBoatStore().getOrCreateBoat(id, name, boatClass, sailId, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-1
@@ -518,7 +518,11 @@ public class TransientCompetitorAndBoatStoreImpl implements CompetitorAndBoatSto
|
||||
protected void addNewBoat(DynamicBoat boat) {
|
||||
LockUtil.lockForWrite(lock);
|
||||
try {
|
||||
boatCache.put(boat.getId(), boat);
|
||||
final Boat existingBoatWithEqualId = boatCache.put(boat.getId(), boat);
|
||||
if (existingBoatWithEqualId != null && existingBoatWithEqualId != boat) {
|
||||
logger.warning("Replaced existing boat "+existingBoatWithEqualId+" with ID "+existingBoatWithEqualId.getId()+
|
||||
" by another boat with equal ID: "+boat);
|
||||
}
|
||||
boatsByIdAsString.put(boat.getId().toString(), boat);
|
||||
} finally {
|
||||
LockUtil.unlockAfterWrite(lock);
|
||||
|
||||
Reference in new issue
Block a user