Java 类com.intellij.util.text.CaseInsensitiveStringHashingStrategy 实例源码

项目:intellij-ce-playground    文件:GeneralCommandLine.java   
protected void setupEnvironment(@NotNull Map<String, String> environment) {
  environment.clear();

  if (myParentEnvironmentType != ParentEnvironmentType.NONE) {
    environment.putAll(getParentEnvironment());
  }

  if (!myEnvParams.isEmpty()) {
    if (SystemInfo.isWindows) {
      THashMap<String, String> envVars = new THashMap<String, String>(CaseInsensitiveStringHashingStrategy.INSTANCE);
      envVars.putAll(environment);
      envVars.putAll(myEnvParams);
      environment.clear();
      environment.putAll(envVars);
    }
    else {
      environment.putAll(myEnvParams);
    }
  }
}
项目:tools-idea    文件:FileTypeAssocTable.java   
private FileTypeAssocTable(Map<String, T> extensionMappings, Map<String, T> exactFileNameMappings, Map<String, T> exactFileNameAnyCaseMappings, List<Pair<FileNameMatcher, T>> matchingMappings) {
  myExtensionMappings = new THashMap<String, T>(extensionMappings);
  myExactFileNameMappings = new THashMap<String, T>(exactFileNameMappings);
  myExactFileNameAnyCaseMappings = new THashMap<String, T>(exactFileNameAnyCaseMappings, CaseInsensitiveStringHashingStrategy.INSTANCE) {
    @Override
    public T remove(Object key) {
      T removed = super.remove(key);
      myHasAnyCaseExactMappings = size() > 0;
      return removed;
    }

    @Override
    public T put(String key, T value) {
      T result = super.put(key, value);
      myHasAnyCaseExactMappings = true;
      return result;
    }
  };
  myMatchingMappings = new ArrayList<Pair<FileNameMatcher, T>>(matchingMappings);
}
项目:tools-idea    文件:GeneralCommandLine.java   
void setupEnvironment(final Map<String, String> environment) {
  environment.clear();

  if (myPassParentEnvironment) {
    environment.putAll(EnvironmentUtil.getEnvironmentMap());
  }

  if (!myEnvParams.isEmpty()) {
    if (SystemInfo.isWindows) {
      THashMap<String, String> envVars = new THashMap<String, String>(CaseInsensitiveStringHashingStrategy.INSTANCE);
      envVars.putAll(environment);
      envVars.putAll(myEnvParams);
      environment.clear();
      environment.putAll(envVars);
    }
    else {
      environment.putAll(myEnvParams);
    }
  }
}
项目:intellij-ce-playground    文件:HeaderParserRepository.java   
@NotNull
@Override
protected Map<String, HeaderParser> compute() {
  Map<String, HeaderParser> map = new THashMap<String, HeaderParser>(CaseInsensitiveStringHashingStrategy.INSTANCE);
  for (HeaderParserProvider provider : Extensions.getExtensions(HeaderParserProvider.EP_NAME)) {
    map.putAll(provider.getHeaderParsers());
  }
  return map;
}
项目:intellij-ce-playground    文件:SourceResolver.java   
@NotNull
private static ObjectIntHashMap<String> createStringIntMap(int initialCapacity) {
  if (initialCapacity == -1) {
    initialCapacity = 4;
  }
  return SystemInfo.isFileSystemCaseSensitive
         ? new ObjectIntHashMap<String>(initialCapacity)
         : new ObjectIntHashMap<String>(initialCapacity, CaseInsensitiveStringHashingStrategy.INSTANCE);
}
项目:intellij-ce-playground    文件:VfsData.java   
void addAdoptedName(String name, boolean caseSensitive) {
  if (myAdoptedNames == null) {
    //noinspection unchecked
    myAdoptedNames = new THashSet<String>(0, caseSensitive ? TObjectHashingStrategy.CANONICAL : CaseInsensitiveStringHashingStrategy.INSTANCE);
  }
  myAdoptedNames.add(name);
}
项目:intellij-ce-playground    文件:EnvironmentUtil.java   
private static Map<String, String> getSystemEnv() {
  if (SystemInfo.isWindows) {
    return unmodifiableMap(new THashMap<String, String>(System.getenv(), CaseInsensitiveStringHashingStrategy.INSTANCE));
  }
  else {
    return System.getenv();
  }
}
项目:tools-idea    文件:EnvironmentUtil.java   
@NotNull
@Override
protected Map<String, String> compute() {
  Map<String, String> env = ourEnvironment.getValue();
  if (SystemInfo.isWindows) {
    env = Collections.unmodifiableMap(new THashMap<String, String>(env, CaseInsensitiveStringHashingStrategy.INSTANCE));
  }
  return env;
}
项目:consulo    文件:GeneralCommandLine.java   
protected void setupEnvironment(@Nonnull Map<String, String> environment) {
  environment.clear();

  if (myParentEnvironmentType != ParentEnvironmentType.NONE) {
    environment.putAll(getParentEnvironment());
  }

  if (SystemInfo.isUnix) {
    File workDirectory = getWorkDirectory();
    if (workDirectory != null) {
      environment.put("PWD", FileUtil.toSystemDependentName(workDirectory.getAbsolutePath()));
    }
  }

  if (!myEnvParams.isEmpty()) {
    if (SystemInfo.isWindows) {
      THashMap<String, String> envVars = new THashMap<>(CaseInsensitiveStringHashingStrategy.INSTANCE);
      envVars.putAll(environment);
      envVars.putAll(myEnvParams);
      environment.clear();
      environment.putAll(envVars);
    }
    else {
      environment.putAll(myEnvParams);
    }
  }
}
项目:consulo    文件:VfsData.java   
void addAdoptedName(String name, boolean caseSensitive) {
  if (myAdoptedNames == null) {
    //noinspection unchecked
    myAdoptedNames = new THashSet<String>(0, caseSensitive ? TObjectHashingStrategy.CANONICAL : CaseInsensitiveStringHashingStrategy.INSTANCE);
  }
  myAdoptedNames.add(name);
}
项目:consulo    文件:EnvironmentUtil.java   
private static Map<String, String> getSystemEnv() {
  if (SystemInfo.isWindows) {
    return unmodifiableMap(new THashMap<String, String>(System.getenv(), CaseInsensitiveStringHashingStrategy.INSTANCE));
  }
  else {
    return System.getenv();
  }
}
项目:intellij-ce-playground    文件:GeneralCommandLine.java   
public MyTHashMap() {
  super(SystemInfo.isWindows ? CaseInsensitiveStringHashingStrategy.INSTANCE : ContainerUtil.<String>canonicalStrategy());
}
项目:consulo    文件:GeneralCommandLine.java   
public MyTHashMap() {
  super(SystemInfo.isWindows ? CaseInsensitiveStringHashingStrategy.INSTANCE : ContainerUtil.<String>canonicalStrategy());
}
项目:consulo    文件:VcsLogPathsIndex.java   
@Override
public int getHashCode(String value) {
  return CaseInsensitiveStringHashingStrategy.INSTANCE.computeHashCode(value);
}
项目:consulo    文件:VcsLogPathsIndex.java   
@Override
public boolean isEqual(String val1, String val2) {
  return CaseInsensitiveStringHashingStrategy.INSTANCE.equals(val1, val2);
}