@@ -0,0 +1,1906 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.%0A// Use of this source code is governed by a BSD-style license that can be%0A// found in the LICENSE file.%0A%0Apackage org.chromium.sdk.internal;%0A%0Aimport java.util.LinkedHashMap;%0Aimport java.util.Map;%0Aimport java.util.concurrent.ConcurrentHashMap;%0A%0A/**%0A * Utility class that behaves similarly to ConcurrentHashMap, but also%0A * provides %7B@link #close%7D operation that stops all new registrations.%0A */%0Apublic class CloseableMap%3CK, V%3E %7B%0A  public static %3CK, V%3E CloseableMap%3CK, V%3E newMap() %7B%0A    return new CloseableMap%3CK, V%3E(new ConcurrentHashMap%3CK, V%3E());%0A  %7D%0A%0A  public static %3CK, V%3E CloseableMap%3CK, V%3E newLinkedMap() %7B%0A    // Creates linked hash map and makes %22get%22 synchronized.%0A    return new CloseableMap%3CK, V%3E(new LinkedHashMap%3CK, V%3E()) %7B%0A      @Override%0A      public synchronized V get(K key) %7B%0A        // Base %22get%22 is not synchronized, because we rely on ConcurrentHashMap.%0A        return super.get(key);%0A      %7D%0A    %7D;%0A  %7D%0A%0A  private final Map%3CK, V%3E map;%0A  private boolean mutationClosed = false;%0A%0A  protected CloseableMap(Map%3CK, V%3E map) %7B%0A    this.map = map;%0A  %7D%0A%0A  public V get(K key) %7B%0A    return map.get(key);%0A  %7D%0A%0A  public synchronized Map%3CK, V%3E close() %7B%0A    if (mutationClosed) %7B%0A      throw new IllegalStateException();%0A    %7D%0A    mutationClosed = true;%0A    return map;%0A  %7D%0A%0A  public synchronized V remove(K key) %7B%0A    if (mutationClosed) %7B%0A      // We probably can safely ignore this.%0A      return null;%0A    %7D%0A    V result = map.remove(key);%0A    if (result == null) %7B%0A      throw new IllegalArgumentException(%22This key is not registered%22);%0A    %7D%0A    return result;%0A  %7D%0A%0A  public synchronized void put(K key, V value) %7B%0A    if (mutationClosed) %7B%0A      throw new IllegalStateException();%0A    %7D%0A    if (map.containsKey(key)) %7B%0A      throw new IllegalStateException(%22Such key is already registered%22);%0A    %7D%0A    map.put(key, value);%0A  %7D%0A%7D%0A

Add lost CloseableMap.java