*/
public class IdentityManager extends AbstractService {
- /** Object used for synchronization. */
- @SuppressWarnings("hiding")
- private final Object syncObject = new Object() {
- /* inner class for better lock names. */
- };
-
/** The logger. */
private static final Logger logger = Logging.getLogger(IdentityManager.class);
* @return All own identities
*/
public Set<OwnIdentity> getAllOwnIdentities() {
- synchronized (syncObject) {
+ synchronized (currentOwnIdentities) {
return new HashSet<OwnIdentity>(currentOwnIdentities);
}
}
detectChangesInIdentities(currentOwnIdentities, currentIdentities, oldIdentities);
oldIdentities = currentIdentities;
- synchronized (syncObject) {
+ synchronized (currentOwnIdentities) {
this.currentOwnIdentities.clear();
this.currentOwnIdentities.addAll(currentOwnIdentities);
}