Code example for MapMaker

0
 */ 
public class TargetResolverObject implements Serializable {
 
  private static final AtomicInteger s_nextIdentifier = new AtomicInteger();
  private static final ConcurrentMap<ComputationTargetResolver.AtVersionCorrection, Integer> s_resolver2identifier = new MapMaker().weakKeys().makeMap();
  private static final ConcurrentMap<Integer, ComputationTargetResolver.AtVersionCorrection> s_identifier2resolver = new MapMaker().weakValues().makeMap();
 
  private transient ComputationTargetResolver.AtVersionCorrection _targetResolver;
 
  protected TargetResolverObject(final ComputationTargetResolver.AtVersionCorrection targetResolver) {
    _targetResolver = targetResolver;
  } 
 
  protected ComputationTargetResolver.AtVersionCorrection getTargetResolver() { 
    return _targetResolver;
  } 
 
  private void writeObject(final ObjectOutputStream out) throws IOException {
    Integer id = s_resolver2identifier.get(getTargetResolver());
    if (id == null) {
Experience pair programming with AI  Get Codota for Java