when traversing dirty files do not visit roots from other targets of module build chunk

This commit is contained in:
Eugene Zhuravlev
2014-08-26 21:04:47 +04:00
parent f4a43c8782
commit e14ae0fe18
2 changed files with 6 additions and 2 deletions
@@ -151,7 +151,7 @@ public class FSOperations {
}
}
public static void processFilesToRecompile(CompileContext context, ModuleBuildTarget target, FileProcessor<JavaSourceRootDescriptor, ModuleBuildTarget> processor) throws IOException {
public static void processFilesToRecompile(CompileContext context, @NotNull ModuleBuildTarget target, FileProcessor<JavaSourceRootDescriptor, ModuleBuildTarget> processor) throws IOException {
context.getProjectDescriptor().fsState.processFilesToRecompile(context, target, processor);
}
@@ -145,13 +145,17 @@ public class BuildFSState extends FSState {
setRoundDelta(CURRENT_ROUND_DELTA_KEY, context, new FilesDelta());
}
public <R extends BuildRootDescriptor, T extends BuildTarget<R>> boolean processFilesToRecompile(CompileContext context, final T target, final FileProcessor<R, T> processor) throws IOException {
public <R extends BuildRootDescriptor, T extends BuildTarget<R>> boolean processFilesToRecompile(CompileContext context, final @NotNull T target, final FileProcessor<R, T> processor) throws IOException {
final Map<BuildRootDescriptor, Set<File>> data = getSourcesToRecompile(context, target);
final CompileScope scope = context.getScope();
synchronized (data) {
for (Map.Entry<BuildRootDescriptor, Set<File>> entry : data.entrySet()) {
//noinspection unchecked
R root = (R)entry.getKey();
if (!target.equals(root.getTarget())) {
// the data can contain roots from other targets (e.g. when compiling module cycles)
continue;
}
for (File file : entry.getValue()) {
if (!scope.isAffected(target, file)) {
continue;