Program: 53488
Project: 53488
Buggy source:
/** 
 * Returns an immutable set of external class names that should not be renamed. The returned set contains all complete class names defined with  {@code @external} as well as all of the class names from{@code styleClassesSet} that match prefixes defined with {@code @external}.
 * @param styleClassesSet a set of class names that should be filtered toreturn those matching external prefixes. Note that the passed-in set is not modified.
 * @return an immutable set of class names. Note that the returned names arenot prefixed with "."; they are the raw name.
 */
public ImmutableSet<String> getExternalClassNames(Set<String> styleClassesSet){
  if (matchAll) {
    return ImmutableSet.copyOf(styleClassesSet);
  }
  SortedSet<String> classNames=new TreeSet<String>(styleClassesSet);
  Builder<String> externalClassesSetBuilder=ImmutableSet.builder();
  externalClassesSetBuilder.addAll(externalClassNames);
  for (  String prefix : externalClassPrefixes) {
    for (    String styleClass : classNames.tailSet(prefix)) {
      if (styleClass.startsWith(prefix)) {
        externalClassesSetBuilder.add(styleClass);
      }
 else {
        break;
      }
    }
  }
  return externalClassesSetBuilder.build();
}

Fixed version (ground truth):
/** 
 * Returns an immutable set of external class names that should not be renamed. The returned set contains all complete class names defined with  {@code @external} as well as all of the class names from{@code styleClassesSet} that match prefixes defined with {@code @external}. <p>The set will contain also the class names that are not in the AST anymore (defined in a conditional node that has been evaluated to false) and are not associated to a java method. That doesn't make sense to rename these class names because they are not in the final css and javascript. Moreover we handle the case where an   {@code @external} related to thesestyle classes has been removed from the AST (because it was also defined in a conditional node evaluated to false) and the compiler doesn't have to throw and error for this case. <pre> / {@literal *} conditional node evaluated to false at compile time {@literal *}/
 * @if (is("property", "true")) {
 * @external foo;.foo { width: 100%; } } </pre>
 * @param styleClassesSet a set of class names that should be filtered toreturn those matching external prefixes. Note that the passed-in set is not modified.
 * @param orphanClassName a set of class names that aren't associated to a java method of theCssResource interface.
 * @return an immutable set of class names. Note that the returned names arenot prefixed with "."; they are the raw name.
 */
public ImmutableSet<String> getExternalClassNames(Set<String> styleClassesSet,Set<String> orphanClassName){
  if (matchAll) {
    return ImmutableSet.copyOf(styleClassesSet);
  }
  SortedSet<String> classNames=new TreeSet<String>(styleClassesSet);
  Builder<String> externalClassesSetBuilder=ImmutableSet.builder();
  externalClassesSetBuilder.addAll(externalClassNames);
  for (  String prefix : externalClassPrefixes) {
    for (    String styleClass : classNames.tailSet(prefix)) {
      if (styleClass.startsWith(prefix)) {
        externalClassesSetBuilder.add(styleClass);
      }
 else {
        break;
      }
    }
  }
  for (  String className : orphanClassName) {
    if (!remainingStyleClassNames.contains(className)) {
      externalClassesSetBuilder.add(className);
    }
  }
  return externalClassesSetBuilder.build();
}