public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
    if (fo instanceof JpsFileObject) {
      final File path = fo instanceof InputFileObject? ((InputFileObject)fo).getFile() : fo instanceof OutputFileObject? ((OutputFileObject)fo).getFile() : null;
      if (path != null) {
        for (Location loc : Iterators.flat(listLocationsForModules(location))) {
          for (File root : getLocation(loc)) {
            if (isAncestor(root, path)) {
              return loc;
            }
          }
        }
      }
      return null;
    }
    return myGetLocationForModuleCall.callDefaultImpl(getStdManager(), location, fo);
  }
public Location getLocationForModule(Location location, JavaFileObject fo)