public static Set<String> checkInheritanceDependencies(List<String> targetSwcs,Set<String> sourceSwcs,CompilerSwcContext swcContext){
  if (sourceSwcs.isEmpty()) {
    return Collections.emptySet();
  }
  Set<String> inheritanceDependencies=new HashSet<String>(64 * sourceSwcs.size());
  Set<String> inheritanceDependencyType=new HashSet<String>();
  inheritanceDependencyType.add(SwcDependencySet.INHERITANCE);
  for (  String sourceSwc : sourceSwcs) {
    Swc swc=swcContext.getSwc(sourceSwc);
    inheritanceDependencies.addAll(getSwcDependencies(swc,inheritanceDependencyType));
  }
  if (inheritanceDependencies.isEmpty())   return Collections.emptySet();
  Set<String> foundSwcs=new HashSet<String>();
  for (ListIterator<String> iter=targetSwcs.listIterator(targetSwcs.size()); iter.hasPrevious(); ) {
    String targetSwc=iter.previous();
    Set<String> scriptNameSet=getSwcScripts(swcContext.getSwc(targetSwc));
    for (    String dependency : inheritanceDependencies) {
      if (scriptNameSet.contains(dependency)) {
        foundSwcs.add(targetSwc);
        if (iter.hasPrevious()) {
          inheritanceDependencies.addAll(getSwcDependencies(swcContext.getSwc(targetSwc),inheritanceDependencyType));
        }
        break;
      }
    }
  }
  return foundSwcs;
}

public static Set < String > checkInheritanceDependencies ( List < String > targetSwcs , Set < String > sourceSwcs , CompilerSwcContext swcContext ) { if ( sourceSwcs . isEmpty ( ) ) { return Collections . emptySet ( ) ; } Set < String > inheritanceDependencies = new HashSet < String > ( 64 * sourceSwcs . size ( ) ) ; Set < String > inheritanceDependencyType = new HashSet < String > ( ) ; inheritanceDependencyType . add ( SwcDependencySet . INHERITANCE ) ; for ( String sourceSwc : sourceSwcs ) { Swc swc = swcContext . getSwc ( sourceSwc ) ; inheritanceDependencies . addAll ( getSwcDependencies ( swc , inheritanceDependencyType ) ) ; } if ( inheritanceDependencies . isEmpty ( ) ) return Collections . emptySet ( ) ; Set < String > foundSwcs = new HashSet < String > ( ) ; for ( ListIterator < String > iter = targetSwcs . listIterator ( targetSwcs . size ( ) ) ; iter . hasPrevious ( ) ; ) { String targetSwc = iter . previous ( ) ; Set < String > scriptNameSet = getSwcScripts ( swcContext . getSwc ( targetSwc ) ) ; for ( String dependency : inheritanceDependencies ) { if ( scriptNameSet . contains ( dependency ) ) { foundSwcs . add ( targetSwc ) ; if ( iter . hasPrevious ( ) ) { inheritanceDependencies . addAll ( getSwcDependencies ( swcContext . getSwc ( targetSwc ) , inheritanceDependencyType ) ) ; } break ; } } } return foundSwcs ; }
check a set of target swcs to see if they contain any inheritance dependencies in a set of source swcs .
