class RenameDuplicatedClasses extends SceneTransformer {
  private static final Logger logger = LoggerFactory.getLogger(RenameDuplicatedClasses.class);

  private static final String FIXED_CLASS_NAME_SPERATOR = "-";

  public RenameDuplicatedClasses(Singletons.Global g) {
  }

  public static RenameDuplicatedClasses v() {
    return G.v().soot_jimple_toolkits_base_RenameDuplicatedClasses();
  }

  @Override
  protected void internalTransform(String phaseName, Map<String, String> options) {<FILL_FUNCTION_BODY>}

  public void duplicatedCheck(Iterable<String> classNames) {
    Set<String> classNameSet = new HashSet<String>();
    for (String className : classNames) {
      if (classNameSet.contains(className.toLowerCase())) {
        throw new RuntimeException("The fixed class names cannot contain duplicated class names.");
      } else {
        classNameSet.add(className.toLowerCase());
      }
    }
  }

  /**
   * An naive approach to check whether the file system is case sensitive or not
   *
   * @return
   */
  public boolean isFileSystemCaseSensitive() {
    File[] allFiles = (new File(".")).listFiles();
    if (allFiles != null) {
      for (File f : allFiles) {
        if (f.isFile()) {
          if (!(new File(f.getAbsolutePath().toLowerCase())).exists()
              || !(new File(f.getAbsolutePath().toUpperCase())).exists()) {
            return true;
          }
        }
      }
    }
    return false;
  }
}

    // If the file system is case sensitive, no need to rename the classes
    if (isFileSystemCaseSensitive()) {
      return;
    }

    final Set<String> fixedClassNames
        = new HashSet<>(Arrays.asList(PhaseOptions.getString(options, "fixedClassNames").split(FIXED_CLASS_NAME_SPERATOR)));
    duplicatedCheck(fixedClassNames);

    if (Options.v().verbose()) {
      logger.debug("The fixed class names are: " + fixedClassNames);
    }

    int count = 0;
    Map<String, String> lowerCaseClassNameToReal = new HashMap<String, String>();
    for (Iterator<SootClass> iter = Scene.v().getClasses().snapshotIterator(); iter.hasNext();) {
      SootClass sootClass = iter.next();
      String className = sootClass.getName();

      if (lowerCaseClassNameToReal.containsKey(className.toLowerCase())) {
        if (fixedClassNames.contains(className)) {
          sootClass = Scene.v().getSootClass(lowerCaseClassNameToReal.get(className.toLowerCase()));
          className = lowerCaseClassNameToReal.get(className.toLowerCase());
        }

        String newClassName = className + (count++);
        sootClass.rename(newClassName);

        // if(Options.v().verbose())
        // {
        logger.debug("Rename duplicated class " + className + " to class " + newClassName);
        // }
      } else {
        lowerCaseClassNameToReal.put(className.toLowerCase(), className);
      }
    }
  
<methods>public non-sealed void <init>() ,public final void transform(java.lang.String, Map<java.lang.String,java.lang.String>) ,public final void transform(java.lang.String) ,public final void transform() <variables>