Program: 53293
Project: 53293
Buggy source:
protected DefaultJavaLibraryRule(BuildRuleParams buildRuleParams,Set<String> srcs,Set<? extends SourcePath> resources,Optional<String> proguardConfig,boolean exportDeps,JavacOptions javacOptions){
  super(buildRuleParams);
  this.srcs=ImmutableSortedSet.copyOf(srcs);
  this.resources=ImmutableSortedSet.copyOf(resources);
  this.proguardConfig=Preconditions.checkNotNull(proguardConfig);
  this.exportDeps=exportDeps;
  this.javacOptions=Preconditions.checkNotNull(javacOptions);
  if (!srcs.isEmpty() || !resources.isEmpty()) {
    this.outputJar=Optional.of(getOutputJarPath(getBuildTarget()));
  }
 else {
    this.outputJar=Optional.absent();
  }
  ImmutableList.Builder<String> builder=ImmutableList.<String>builder().addAll(this.srcs);
  builder.addAll(SourcePaths.filterInputsToCompareToOutput(resources));
  inputsToConsiderForCachingPurposes=builder.build();
  outputClasspathEntriesSupplier=Suppliers.memoize(new Supplier<ImmutableSetMultimap<JavaLibraryRule,String>>(){
    @Override public ImmutableSetMultimap<JavaLibraryRule,String> get(){
      ImmutableSetMultimap<JavaLibraryRule,String> outputClasspathEntries;
      if (DefaultJavaLibraryRule.this.exportDeps) {
        outputClasspathEntries=getTransitiveClasspathEntries();
      }
 else       if (outputJar.isPresent()) {
        outputClasspathEntries=ImmutableSetMultimap.<JavaLibraryRule,String>builder().put(DefaultJavaLibraryRule.this,getPathToOutputFile()).build();
      }
 else {
        outputClasspathEntries=ImmutableSetMultimap.of();
      }
      return outputClasspathEntries;
    }
  }
);
  transitiveClasspathEntriesSupplier=Suppliers.memoize(new Supplier<ImmutableSetMultimap<JavaLibraryRule,String>>(){
    @Override public ImmutableSetMultimap<JavaLibraryRule,String> get(){
      final ImmutableSetMultimap.Builder<JavaLibraryRule,String> classpathEntries=ImmutableSetMultimap.builder();
      ImmutableSetMultimap<JavaLibraryRule,String> classpathEntriesForDeps=Classpaths.getClasspathEntries(getDeps());
      classpathEntries.putAll(classpathEntriesForDeps);
      if (DefaultJavaLibraryRule.this.exportDeps) {
        classpathEntries.putAll(DefaultJavaLibraryRule.this,classpathEntriesForDeps.values());
      }
      if (outputJar.isPresent()) {
        classpathEntries.putAll(DefaultJavaLibraryRule.this,getPathToOutputFile());
      }
      return classpathEntries.build();
    }
  }
);
  declaredClasspathEntriesSupplier=Suppliers.memoize(new Supplier<ImmutableSetMultimap<JavaLibraryRule,String>>(){
    @Override public ImmutableSetMultimap<JavaLibraryRule,String> get(){
      final ImmutableSetMultimap.Builder<JavaLibraryRule,String> classpathEntries=ImmutableSetMultimap.builder();
      Iterable<JavaLibraryRule> javaLibraryDeps=Iterables.filter(Sets.union(getDeps(),ImmutableSet.of(DefaultJavaLibraryRule.this)),JavaLibraryRule.class);
      for (      JavaLibraryRule rule : javaLibraryDeps) {
        classpathEntries.putAll(rule,rule.getOutputClasspathEntries().values());
      }
      return classpathEntries.build();
    }
  }
);
}

Fixed version (ground truth):
protected DefaultJavaLibraryRule(BuildRuleParams buildRuleParams,Set<String> srcs,Set<? extends SourcePath> resources,Optional<String> proguardConfig,boolean exportDeps,JavacOptions javacOptions){
  super(buildRuleParams);
  this.srcs=ImmutableSortedSet.copyOf(srcs);
  this.resources=ImmutableSortedSet.copyOf(resources);
  this.proguardConfig=Preconditions.checkNotNull(proguardConfig);
  this.exportDeps=exportDeps;
  this.javacOptions=Preconditions.checkNotNull(javacOptions);
  if (!srcs.isEmpty() || !resources.isEmpty()) {
    this.outputJar=Optional.of(getOutputJarPath(getBuildTarget()));
  }
 else {
    this.outputJar=Optional.absent();
  }
  ImmutableList.Builder<String> builder=ImmutableList.<String>builder().addAll(this.srcs);
  builder.addAll(SourcePaths.filterInputsToCompareToOutput(resources));
  inputsToConsiderForCachingPurposes=builder.build();
  outputClasspathEntriesSupplier=Suppliers.memoize(new Supplier<ImmutableSetMultimap<JavaLibraryRule,String>>(){
    @Override public ImmutableSetMultimap<JavaLibraryRule,String> get(){
      ImmutableSetMultimap<JavaLibraryRule,String> outputClasspathEntries;
      if (DefaultJavaLibraryRule.this.exportDeps) {
        outputClasspathEntries=getTransitiveClasspathEntries();
      }
 else       if (outputJar.isPresent()) {
        outputClasspathEntries=ImmutableSetMultimap.<JavaLibraryRule,String>builder().put(DefaultJavaLibraryRule.this,getPathToOutputFile()).build();
      }
 else {
        outputClasspathEntries=ImmutableSetMultimap.of();
      }
      return outputClasspathEntries;
    }
  }
);
  transitiveClasspathEntriesSupplier=Suppliers.memoize(new Supplier<ImmutableSetMultimap<JavaLibraryRule,String>>(){
    @Override public ImmutableSetMultimap<JavaLibraryRule,String> get(){
      final ImmutableSetMultimap.Builder<JavaLibraryRule,String> classpathEntries=ImmutableSetMultimap.builder();
      ImmutableSetMultimap<JavaLibraryRule,String> classpathEntriesForDeps=Classpaths.getClasspathEntries(getDeps());
      classpathEntries.putAll(classpathEntriesForDeps);
      if (DefaultJavaLibraryRule.this.exportDeps) {
        classpathEntries.putAll(DefaultJavaLibraryRule.this,classpathEntriesForDeps.values());
      }
      if (outputJar.isPresent()) {
        classpathEntries.putAll(DefaultJavaLibraryRule.this,getPathToOutputFile());
      }
      return classpathEntries.build();
    }
  }
);
  declaredClasspathEntriesSupplier=Suppliers.memoize(new Supplier<ImmutableSetMultimap<JavaLibraryRule,String>>(){
    @Override public ImmutableSetMultimap<JavaLibraryRule,String> get(){
      final ImmutableSetMultimap.Builder<JavaLibraryRule,String> classpathEntries=ImmutableSetMultimap.builder();
      Iterable<JavaLibraryRule> javaLibraryDeps=Iterables.filter(getDeps(),JavaLibraryRule.class);
      for (      JavaLibraryRule rule : javaLibraryDeps) {
        classpathEntries.putAll(rule,rule.getOutputClasspathEntries().values());
      }
      return classpathEntries.build();
    }
  }
);
}