com.intellij.util.text.CaseInsensitiveStringHashingStrategy Java Examples

The following examples show how to use com.intellij.util.text.CaseInsensitiveStringHashingStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GeneralCommandLine.java    From consulo with Apache License 2.0 5 votes vote down vote up
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);
    }
  }
}
 
Example #2
Source File: EnvironmentUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static Map<String, String> getSystemEnv() {
  if (SystemInfo.isWindows) {
    return unmodifiableMap(new THashMap<String, String>(System.getenv(), CaseInsensitiveStringHashingStrategy.INSTANCE));
  }
  else {
    return System.getenv();
  }
}
 
Example #3
Source File: GeneralCommandLine.java    From consulo with Apache License 2.0 4 votes vote down vote up
public MyTHashMap() {
  super(SystemInfo.isWindows ? CaseInsensitiveStringHashingStrategy.INSTANCE : ContainerUtil.<String>canonicalStrategy());
}
 
Example #4
Source File: VcsLogPathsIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public int getHashCode(String value) {
  return CaseInsensitiveStringHashingStrategy.INSTANCE.computeHashCode(value);
}
 
Example #5
Source File: VcsLogPathsIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isEqual(String val1, String val2) {
  return CaseInsensitiveStringHashingStrategy.INSTANCE.equals(val1, val2);
}