CompileScope () { final Collection<BuildTargetType<?>> typesToForceBuild; if (myForceBuild) { typesToForceBuild = new SmartHashSet<>(); typesToForceBuild.addAll(myTargetTypes); for (BuildTarget<?> target : myTargets) { typesToForceBuild.add(target.getTargetType()); } } else { typesToForceBuild = Collections.emptyList(); } return new CompileScopeImpl(myTargetTypes, typesToForceBuild, myTargets, myFiles); }