/*
 * Copyright 2000-2013 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.util.containers;

import java.util.Map;

/**
 * @author peter
 */
public abstract class ConcurrentFactoryMap<T,V> extends FactoryMap<T,V> {
  @Override
  protected Map<T, V> createMap() {
    return new ConcurrentHashMap<T,V>();
  }
}

@@ -633,16 +633,62 @@
 iners;%0A%0A
+import com.intellij.openapi.util.SystemInfo;%0A%0A
 import j
@@ -701,16 +701,16 @@
 il.Map;%0A
-
 %0A/**%0A * 
@@ -801,16 +801,703 @@
 %3CT,V%3E %7B%0A
+%0A  private interface MapFactory %7B%0A    int DEFAULT_CONCURRENCY_LEVEL = Runtime.getRuntime().availableProcessors();%0A%0A    MapFactory V8_MAP_FACTORY = new MapFactory() %7B%0A      public %3CT, V%3E Map%3CT, V%3E createMap() %7B%0A        return new ConcurrentHashMap%3CT,V%3E();%0A      %7D%0A    %7D;%0A    MapFactory DEFAULT_MAP_FACTORY = new MapFactory() %7B%0A      public %3CT, V%3E Map%3CT, V%3E createMap() %7B%0A        return new java.util.concurrent.ConcurrentHashMap%3CT,V%3E(16, 0.75f, DEFAULT_CONCURRENCY_LEVEL);%0A      %7D%0A    %7D;%0A%0A    %3CT, V%3E Map%3CT, V%3E createMap();%0A  %7D%0A%0A  private static final MapFactory ourMapFactory = SystemInfo.isOracleJvm %7C%7C SystemInfo.isAppleJvm? MapFactory.V8_MAP_FACTORY : MapFactory.DEFAULT_MAP_FACTORY;%0A%0A
   @Overr
@@ -1551,34 +1551,31 @@
 urn 
-new ConcurrentHashMap%3CT,V%3E
+ourMapFactory.createMap
 ();%0A

use backported V8 CHM only for Oracle or Apple JDK (IDEA-116404 Java code compilation does not work with IBM JDK)