Program: 59814
Project: 59814
Buggy source:
@SuppressWarnings("String_Node_Str") <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 JavaInstance) {
    return ((JavaInstance<T>)plan).instance;
  }
 else   if (plan instanceof Constructor) {
    Constructor<T> constructor=(Constructor<T>)plan;
    if (singletonInstances.containsKey(constructor.getNode())) {
      if (constructor.getNode().isUnit()) {
        return (T)singletonInstances.get(constructor.getNode());
      }
 else {
        throw new SingletonInjectionException("String_Node_Str" + constructor.getNode());
      }
    }
    Object[] args=new Object[constructor.getArgs().length];
    for (int i=0; i < constructor.getArgs().length; i++) {
      args[i]=injectFromPlan(constructor.getArgs()[i]);
    }
    if (!singletonInstances.containsKey(constructor.getNode())) {
      try {
        T ret=getConstructor((ConstructorDef<T>)constructor.getConstructorDef()).newInstance(args);
        if (c.isSingleton(constructor.getNode()) || constructor.getNode().isUnit()) {
          singletonInstances.put(constructor.getNode(),ret);
        }
        return ret;
      }
 catch (      ReflectiveOperationException e) {
        throw new InjectionException("String_Node_Str",e);
      }
    }
 else {
      return (T)singletonInstances.get(constructor.getNode());
    }
  }
 else   if (plan instanceof Subplan) {
    Subplan<T> ambiguous=(Subplan<T>)plan;
    if (ambiguous.isInjectable()) {
      Node ambigNode=ambiguous.getNode();
      boolean ambigIsUnit=ambigNode instanceof ClassNode && ((ClassNode<?>)ambigNode).isUnit();
      if (singletonInstances.containsKey(ambiguous.getNode())) {
        if (ambigIsUnit) {
          return (T)singletonInstances.get(ambiguous.getNode());
        }
 else {
          throw new SingletonInjectionException("String_Node_Str" + ambiguous.getNode());
        }
      }
      Object ret=injectFromPlan(ambiguous.getDelegatedPlan());
      if (c.isSingleton(ambiguous.getNode()) || ambigIsUnit) {
        singletonInstances.put((ClassNode<?>)ambiguous.getNode(),ret);
      }
      if (ret instanceof ExternalConstructor) {
        return ((ExternalConstructor<T>)ret).newInstance();
      }
 else {
        return (T)ret;
      }
    }
 else {
      if (ambiguous.getNumAlternatives() == 0) {
        throw new InjectionException("String_Node_Str" + plan.toPrettyString());
      }
 else {
        throw new InjectionException("String_Node_Str" + plan.toPrettyString());
      }
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str" + plan);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") <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 JavaInstance) {
    return ((JavaInstance<T>)plan).instance;
  }
 else   if (plan instanceof Constructor) {
    final Constructor<T> constructor=(Constructor<T>)plan;
    if (singletonInstances.containsKey(constructor.getNode())) {
      if (constructor.getNode().isUnit()) {
        return (T)singletonInstances.get(constructor.getNode());
      }
 else {
        throw new SingletonInjectionException("String_Node_Str" + constructor.getNode());
      }
    }
    Object[] args=new Object[constructor.getArgs().length];
    for (int i=0; i < constructor.getArgs().length; i++) {
      args[i]=injectFromPlan(constructor.getArgs()[i]);
    }
    if (!singletonInstances.containsKey(constructor.getNode())) {
      try {
        T ret=getConstructor((ConstructorDef<T>)constructor.getConstructorDef()).newInstance(args);
        if (c.isSingleton(constructor.getNode()) || constructor.getNode().isUnit()) {
          if (!singletonInstances.containsKey(constructor.getNode())) {
            singletonInstances.put(constructor.getNode(),ret);
          }
        }
        return ret;
      }
 catch (      ReflectiveOperationException e) {
        throw new InjectionException("String_Node_Str",e);
      }
    }
 else {
      return (T)singletonInstances.get(constructor.getNode());
    }
  }
 else   if (plan instanceof Subplan) {
    Subplan<T> ambiguous=(Subplan<T>)plan;
    if (ambiguous.isInjectable()) {
      Node ambigNode=ambiguous.getNode();
      boolean ambigIsUnit=ambigNode instanceof ClassNode && ((ClassNode<?>)ambigNode).isUnit();
      if (singletonInstances.containsKey(ambiguous.getNode())) {
        if (ambigIsUnit) {
          return (T)singletonInstances.get(ambiguous.getNode());
        }
 else {
          throw new SingletonInjectionException("String_Node_Str" + ambiguous.getNode());
        }
      }
      Object ret=injectFromPlan(ambiguous.getDelegatedPlan());
      if (c.isSingleton(ambiguous.getNode()) || ambigIsUnit) {
        singletonInstances.put((ClassNode<?>)ambiguous.getNode(),ret);
      }
      if (ret instanceof ExternalConstructor) {
        return ((ExternalConstructor<T>)ret).newInstance();
      }
 else {
        return (T)ret;
      }
    }
 else {
      if (ambiguous.getNumAlternatives() == 0) {
        throw new InjectionException("String_Node_Str" + plan.toPrettyString());
      }
 else {
        throw new InjectionException("String_Node_Str" + plan.toPrettyString());
      }
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str" + plan);
  }
}