@Override
  public <R extends BuildRootDescriptor> void associateTempRoot(@NotNull CompileContext context, @NotNull BuildTarget<R> target, @NotNull R root) {
    Map<File, BuildRootDescriptor> rootToDescriptorMap = ROOT_DESCRIPTOR_MAP.get(context);
    if (rootToDescriptorMap == null) {
      rootToDescriptorMap = FileCollectionFactory.createCanonicalFileMap();
      ROOT_DESCRIPTOR_MAP.set(context, rootToDescriptorMap);
    }

    Map<BuildTarget<?>, List<? extends BuildRootDescriptor>> targetToRootMap = TEMP_TARGET_ROOTS_MAP.get(context);
    if (targetToRootMap == null) {
      targetToRootMap = new HashMap<>();
      TEMP_TARGET_ROOTS_MAP.set(context, targetToRootMap);
    }

    final BuildRootDescriptor d = rootToDescriptorMap.get(root.getRootFile());
    if (d != null) {
      return;
    }

    //noinspection unchecked
    List<R> targetRoots = (List<R>)targetToRootMap.get(target);
    if (targetRoots == null) {
      targetRoots = new ArrayList<>();
      targetToRootMap.put(target, targetRoots);
    }
    rootToDescriptorMap.put(root.getRootFile(), root);
    targetRoots.add(root);
  }
@Override
  public <R extends BuildRootDescriptor> void associateTempRoot(@NotNull CompileContext context, @NotNull BuildTarget<R> target, @NotNull R root)