class SootModuleResolver extends SootResolver {

  public SootModuleResolver(Singletons.Global g) {
    super(g);
  }

  public static SootModuleResolver v() {
    return G.v().soot_SootModuleResolver();
  }

  public SootClass makeClassRef(String className, Optional<String> moduleName) {
    // If this class name is escaped, we need to un-escape it
    className = Scene.unescapeName(className);

    String module = null;
    if (moduleName.isPresent()) {
      module = ModuleUtil.v().declaringModule(className, moduleName.get());
    }

    // if no module return first one found
    final ModuleScene modScene = ModuleScene.v();
    if (modScene.containsClass(className, Optional.fromNullable(module))) {
      return modScene.getSootClass(className, Optional.fromNullable(module));
    }

    SootClass newClass;
    if (className.endsWith(SootModuleInfo.MODULE_INFO)) {
      newClass = new SootModuleInfo(className, module);
    } else {
      newClass = modScene.makeSootClass(className, module);
    }
    newClass.setResolvingLevel(SootClass.DANGLING);
    modScene.addClass(newClass);

    return newClass;
  }

  @Override
  public SootClass makeClassRef(String className) {
    ModuleUtil.ModuleClassNameWrapper wrapper = ModuleUtil.v().makeWrapper(className);
    return makeClassRef(wrapper.getClassName(), wrapper.getModuleNameOptional());
  }

  /**
   * Resolves the given class. Depending on the resolver settings, may decide to resolve other classes as well. If the class
   * has already been resolved, just returns the class that was already resolved.
   */
  public SootClass resolveClass(String className, int desiredLevel, Optional<String> moduleName) {<FILL_FUNCTION_BODY>}

  @Override
  public SootClass resolveClass(String className, int desiredLevel) {
    ModuleUtil.ModuleClassNameWrapper wrapper = ModuleUtil.v().makeWrapper(className);
    return resolveClass(wrapper.getClassName(), desiredLevel, wrapper.getModuleNameOptional());
  }
}

    SootClass resolvedClass = null;
    try {
      resolvedClass = makeClassRef(className, moduleName);
      addToResolveWorklist(resolvedClass, desiredLevel);
      processResolveWorklist();
      return resolvedClass;
    } catch (SootClassNotFoundException e) {
      // remove unresolved class and rethrow
      if (resolvedClass != null) {
        assert (resolvedClass.resolvingLevel() == SootClass.DANGLING);
        ModuleScene.v().removeClass(resolvedClass);
      }
      throw e;
    }
  
<methods>public void <init>(Singletons.Global) ,public Program getProgram() ,public soot.SootClass makeClassRef(java.lang.String) ,public void reResolve(soot.SootClass, int) ,public void reResolve(soot.SootClass) ,public void reResolveHierarchy(soot.SootClass, int) ,public soot.SootClass resolveClass(java.lang.String, int) ,public static soot.SootResolver v() <variables>protected MultiMap<soot.SootClass,soot.Type> classToTypesHierarchy,protected MultiMap<soot.SootClass,soot.Type> classToTypesSignature,private static final org.slf4j.Logger logger,private Program program,private final Deque<soot.SootClass>[] worklist