void (DiffState state) { final Collection<ClassRepr> addedClasses = state.myClassDiff.added(); if (addedClasses.isEmpty()) { return; } debug("Processing added classes:"); if (!myEasyMode && myFilter != null) { // checking if this newly added class duplicates already existing one assert myCompiledFiles != null; assert myAffectedFiles != null; for (ClassRepr c : addedClasses) { if (!c.isLocal() && !c.isAnonymous() && isEmpty(c.getOuterClassName())) { final Set<File> candidates = FileCollectionFactory.createCanonicalFileSet(); final Iterable<File> currentlyMapped = classToSourceFileGet(c.name); if (currentlyMapped != null) { ContainerUtil.addAll(candidates, currentlyMapped); } candidates.removeAll(myCompiledFiles); final Iterable<File> newSources = myDelta.classToSourceFileGet(c.name); if (newSources != null) { removeAll(candidates, newSources); } final Set<File> nonExistentOrOutOfScope = FileCollectionFactory.createCanonicalFileSet(); for (final File candidate : candidates) { if (!candidate.exists() || !myFilter.belongsToCurrentTargetChunk(candidate)) { nonExistentOrOutOfScope.add(candidate); } } candidates.removeAll(nonExistentOrOutOfScope); if (!candidates.isEmpty()) { // Possibly duplicate classes from different sets of source files // Schedule for recompilation both to make possible 'duplicate sources' error evident candidates.clear(); // just reusing the container if (currentlyMapped != null) { ContainerUtil.addAll(candidates, currentlyMapped); } if (newSources != null) { ContainerUtil.addAll(candidates, newSources); } candidates.removeAll(nonExistentOrOutOfScope); if (myDebugS.isDebugEnabled()) { final StringBuilder msg = new StringBuilder(); msg.append("Possibly duplicated classes; Scheduling for recompilation sources: "); for (File file : candidates) { msg.append(file.getPath()).append("; "); } debug(msg.toString()); } myAffectedFiles.addAll(candidates); return; // do not process this file because it should not be integrated } } } } for (final ClassRepr c : addedClasses) { debug("Class name: ", c.name); myDelta.addAddedClass(c); for (final TypeRepr.ClassType sup : c.getSuperTypes()) { myDelta.registerAddedSuperClass(c.name, sup.className); } if (!myEasyMode && !c.isAnonymous() && !c.isLocal()) { final IntSet toAffect = new IntOpenHashSet(); toAffect.add(c.name); final IntSet classes = myShortClassNameIndex.get(myContext.get(c.getShortName())); if (classes != null) { // affecting dependencies on all other classes with the same short name toAffect.addAll(classes); } toAffect.forEach(qName -> { final IntSet depClasses = myClassToClassDependency.get(qName); if (depClasses != null) { affectCorrespondingSourceFiles(depClasses); } }); } } debug("End of added classes processing."); }