Program: 59820
Project: 59820
Buggy source:
<T>T injectFromPlan(InjectionPlan<T> plan) throws InjectionException {
  if (!plan.isFeasible()) {
    throw new InjectionException("String_Node_Str" + plan.toPrettyString());
  }
  if (plan.isAmbiguous()) {
    throw new IllegalArgumentException("String_Node_Str" + plan.toPrettyString());
  }
  if (plan instanceof InjectionPlan.Instance) {
    return ((InjectionPlan.Instance<T>)plan).instance;
  }
 else   if (plan instanceof InjectionPlan.Constructor) {
    InjectionPlan.Constructor<T> constructor=(InjectionPlan.Constructor<T>)plan;
    Object[] args=new Object[constructor.args.length];
    for (int i=0; i < constructor.args.length; i++) {
      args[i]=injectFromPlan(constructor.args[i]);
    }
    try {
      return constructor.constructor.constructor.newInstance(args);
    }
 catch (    ReflectiveOperationException e) {
      throw new InjectionException("String_Node_Str",e);
    }
  }
 else   if (plan instanceof AmbiguousInjectionPlan) {
    AmbiguousInjectionPlan<T> ambiguous=(AmbiguousInjectionPlan<T>)plan;
    for (    InjectionPlan<? extends T> p : ambiguous.alternatives) {
      if (p.isInjectable() && !p.isAmbiguous()) {
        return injectFromPlan(p);
      }
    }
    throw new IllegalStateException("String_Node_Str");
  }
 else   if (plan instanceof InfeasibleInjectionPlan) {
    throw new InjectionException("String_Node_Str" + plan.toPrettyString());
  }
 else {
    throw new IllegalStateException("String_Node_Str" + plan);
  }
}

Fixed version (ground truth):
<T>T injectFromPlan(InjectionPlan<T> plan) throws InjectionException {
  if (!plan.isFeasible()) {
    throw new InjectionException("String_Node_Str" + plan.toPrettyString());
  }
  if (plan.isAmbiguous()) {
    throw new IllegalArgumentException("String_Node_Str" + plan.toPrettyString());
  }
  if (plan instanceof InjectionPlan.Instance) {
    return ((InjectionPlan.Instance<T>)plan).instance;
  }
 else   if (plan instanceof InjectionPlan.DelegatedImpl) {
    InjectionPlan.DelegatedImpl<T> delegated=(DelegatedImpl<T>)plan;
    if (tc.singletonInstances.containsKey(delegated.getNode())) {
      throw new SingletonInjectionException("String_Node_Str" + delegated.getNode());
    }
    T ret=injectFromPlan(delegated.impl);
    if (tc.singletons.contains(delegated.getNode())) {
      tc.singletonInstances.put(delegated.getNode(),ret);
    }
    return ret;
  }
 else   if (plan instanceof InjectionPlan.Constructor) {
    InjectionPlan.Constructor<T> constructor=(InjectionPlan.Constructor<T>)plan;
    if (tc.singletonInstances.containsKey(constructor.getNode())) {
      throw new SingletonInjectionException("String_Node_Str" + constructor.getNode());
    }
    Object[] args=new Object[constructor.args.length];
    for (int i=0; i < constructor.args.length; i++) {
      args[i]=injectFromPlan(constructor.args[i]);
    }
    try {
      T ret=constructor.constructor.constructor.newInstance(args);
      if (tc.singletons.contains(constructor.getNode())) {
        tc.singletonInstances.put(constructor.getNode(),ret);
      }
      System.err.println("String_Node_Str" + constructor.getNode());
      return ret;
    }
 catch (    ReflectiveOperationException e) {
      throw new InjectionException("String_Node_Str",e);
    }
  }
 else   if (plan instanceof AmbiguousInjectionPlan) {
    AmbiguousInjectionPlan<T> ambiguous=(AmbiguousInjectionPlan<T>)plan;
    for (    InjectionPlan<? extends T> p : ambiguous.alternatives) {
      if (p.isInjectable() && !p.isAmbiguous()) {
        return injectFromPlan(p);
      }
    }
    throw new IllegalStateException("String_Node_Str");
  }
 else   if (plan instanceof InfeasibleInjectionPlan) {
    throw new InjectionException("String_Node_Str" + plan.toPrettyString());
  }
 else {
    throw new IllegalStateException("String_Node_Str" + plan);
  }
}