public void deleteSearchFavourite(SearchFavourite sf) throws IOException {
		synchronized (lock) {
			if (sf == null || sf.getId() == null) {
				throw new IllegalArgumentException("null, or id not set!");
			} else {
				allFavourites.remove(sf.getId());
				if (sf.isShared()) {
					sharedFavourites.remove(sf.getId());
				} else {
					if (sf.getCreator() != null) {
						Map<Long, SearchFavourite> favs = privateFavourites.get(sf.getCreator());
						if (favs != null) {
							favs.remove(sf.getId());
						}
					} else {
						log.warn("Creator is not set! I'm not checking all users so I'm giving up.");
					}
				}
			}
		}
	}
public void deleteSearchFavourite ( SearchFavourite sf ) throws IOException { synchronized ( lock ) { if ( sf == null || sf . getId ( ) == null ) { throw new IllegalArgumentException ( "null, or id not set!" ) ; } else { allFavourites . remove ( sf . getId ( ) ) ; if ( sf . isShared ( ) ) { sharedFavourites . remove ( sf . getId ( ) ) ; } else { if ( sf . getCreator ( ) != null ) { Map < Long , SearchFavourite > favs = privateFavourites . get ( sf . getCreator ( ) ) ; if ( favs != null ) { favs . remove ( sf . getId ( ) ) ; } } else { log . warn ( "Creator is not set! I'm not checking all users so I'm giving up." ) ; } } } } }
If creator is not set, only shared favourites will be checked (if
shared)!