nus-yam/ex-repair huggingface dataset:
Program: 59774
Project: 59774
Buggy source:
@Override protected String toAmbiguousInjectString(){
  if (alternatives.length == 1) {
    return alternatives[0].toAmbiguousInjectString();
  }
 else   if (selectedIndex != -1) {
    return alternatives[selectedIndex].toAmbiguousInjectString();
  }
 else {
    List<InjectionPlan<?>> alts=new ArrayList<>();
    for (    InjectionPlan<?> alt : alternatives) {
      if (alt.isFeasible()) {
        alts.add(alt);
      }
    }
    if (alts.size() == 1) {
      throw new IllegalStateException("String_Node_Str" + alts.get(0).toPrettyString());
    }
    StringBuffer sb=new StringBuffer("String_Node_Str" + getNode().getFullName());
    for (    InjectionPlan<?> alt : alts) {
      sb.append("String_Node_Str" + alt.toShallowString() + "String_Node_Str");
    }
    sb.append("String_Node_Str");
    return sb.toString();
  }
}

Fixed version (ground truth):
@Override protected String toAmbiguousInjectString(){
  if (alternatives.length == 1) {
    return alternatives[0].toAmbiguousInjectString();
  }
 else   if (selectedIndex != -1) {
    return alternatives[selectedIndex].toAmbiguousInjectString();
  }
 else {
    List<InjectionPlan<?>> alts=new ArrayList<>();
    for (    InjectionPlan<?> alt : alternatives) {
      if (alt.isAmbiguous()) {
        alts.add(alt);
      }
    }
    if (alts.size() == 1) {
      return alts.get(0).toAmbiguousInjectString();
    }
    StringBuffer sb=new StringBuffer("String_Node_Str" + getNode().getFullName());
    for (    InjectionPlan<?> alt : alts) {
      sb.append("String_Node_Str" + alt.toShallowString() + "String_Node_Str");
    }
    sb.append("String_Node_Str");
    return sb.toString();
  }
}
Program: 59775
Project: 59775
Buggy source:
@Override public Injector createChildInjector(Configuration... configurations) throws BindException {
  return forkInjector(configurations);
}

Fixed version (ground truth):
@Override @Deprecated public Injector createChildInjector(Configuration... configurations) throws BindException {
  return forkInjector(configurations);
}
Program: 59776
Project: 59776
Buggy source:
private static InjectorImpl copy(InjectorImpl old,Configuration... configurations) throws BindException {
  final InjectorImpl i;
  try {
    final ConfigurationBuilder cb=old.c.newBuilder();
    for (    Configuration c : configurations) {
      cb.addConfiguration(c);
    }
    i=new InjectorImpl(cb.build());
  }
 catch (  BindException e) {
    throw new IllegalStateException("String_Node_Str",e);
  }
  for (  ClassNode<?> cn : old.instances.keySet()) {
    if (!(cn.getFullName().equals("String_Node_Str"))) {
      try {
        ClassNode<?> new_cn=(ClassNode<?>)i.namespace.getNode(cn.getFullName());
        i.instances.put(new_cn,old.instances.get(cn));
      }
 catch (      BindException e) {
        throw new IllegalStateException("String_Node_Str" + cn.getFullName() + "String_Node_Str");
      }
    }
  }
  for (  NamedParameterNode<?> np : old.namedParameterInstances.keySet()) {
    Object o=old.namedParameterInstances.get(np);
    NamedParameterNode<?> new_np=(NamedParameterNode<?>)i.namespace.getNode(np.getFullName());
    i.namedParameterInstances.put(new_np,o);
  }
  if (old.aspect != null) {
    i.bindAspect(old.aspect.createChildAspect());
  }
  return i;
}

Fixed version (ground truth):
private static InjectorImpl copy(InjectorImpl old,Configuration... configurations) throws BindException {
  final InjectorImpl i;
  try {
    final ConfigurationBuilder cb=old.c.newBuilder();
    for (    Configuration c : configurations) {
      cb.addConfiguration(c);
    }
    i=new InjectorImpl(cb.build());
  }
 catch (  BindException e) {
    throw new IllegalStateException("String_Node_Str",e);
  }
  for (  ClassNode<?> cn : old.instances.keySet()) {
    if (cn.getFullName().equals(ReflectionUtilities.getFullName(Injector.class)) || cn.getFullName().equals(ReflectionUtilities.getFullName(InjectorImpl.class))) {
      throw new IllegalStateException();
    }
    try {
      ClassNode<?> new_cn=(ClassNode<?>)i.namespace.getNode(cn.getFullName());
      i.instances.put(new_cn,old.instances.get(cn));
    }
 catch (    BindException e) {
      throw new IllegalStateException("String_Node_Str" + cn.getFullName() + "String_Node_Str");
    }
  }
  for (  NamedParameterNode<?> np : old.namedParameterInstances.keySet()) {
    Object o=old.namedParameterInstances.get(np);
    NamedParameterNode<?> new_np=(NamedParameterNode<?>)i.namespace.getNode(np.getFullName());
    i.namedParameterInstances.put(new_np,o);
  }
  if (old.aspect != null) {
    i.bindAspect(old.aspect.createChildAspect());
  }
  return i;
}
Program: 59781
Project: 59781
Buggy source:
public String toHtmlString(NamedParameterNode<?> n,String pack){
  final String sep="String_Node_Str";
  String fullName=stripPrefix(n.getFullName(),pack);
  StringBuilder sb=new StringBuilder("String_Node_Str" + n.getSimpleArgName() + sep+ fullName+ sep);
  if (n.getDefaultInstanceAsString() != null) {
    String instance=stripPrefix(n.getDefaultInstanceAsString(),pack);
    sb.append(instance);
  }
  sb.append(sep);
  if (!n.getDocumentation().equals("String_Node_Str")) {
    sb.append(n.getDocumentation());
  }
  Set<Node> uses=getUsesOf(n);
  sb.append(sep);
  for (  Node u : uses) {
    sb.append(stripPrefix(u.getFullName(),pack) + "String_Node_Str");
  }
  sb.append(sep);
  for (  Field f : getSettersOf(n)) {
    sb.append(stripPrefix(ReflectionUtilities.getFullName(f),pack) + "String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String toHtmlString(ClassNode<?> n,String pack){
  final String sep="String_Node_Str";
  String fullName=stripPrefix(n.getFullName(),pack);
  final String type;
  try {
    if (ch.classForName(n.getFullName()).isInterface()) {
      type="String_Node_Str";
    }
 else {
      type="String_Node_Str";
    }
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
  StringBuilder sb=new StringBuilder("String_Node_Str" + type + sep+ fullName+ sep);
  if (n.getDefaultImplementation() != null) {
    String instance=stripPrefix(n.getDefaultImplementation(),pack);
    sb.append(instance);
  }
  sb.append(sep);
  sb.append("String_Node_Str");
  Set<Node> uses=getUsesOf(n);
  sb.append(sep);
  for (  Node u : uses) {
    sb.append(stripPrefix(u.getFullName(),pack) + "String_Node_Str");
  }
  sb.append(sep);
  for (  Field f : getSettersOf(n)) {
    sb.append(stripPrefix(ReflectionUtilities.getFullName(f),pack) + "String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 59782
Project: 59782
Buggy source:
@Override public boolean visit(ClassNode<?> node){
  return true;
}

Fixed version (ground truth):
@Override public boolean visit(ClassNode<?> node){
  if (usedKeys.contains(node.getFullName())) {
    names.add(node);
  }
  if (setterKeys.contains(node)) {
    names.add(node);
  }
  return true;
}
Program: 59783
Project: 59783
Buggy source:
public Set<Node> getUsesOf(final NamedParameterNode<?> name){
  return usages.getValuesForKey(name.getFullName());
}

Fixed version (ground truth):
public Set<Node> getUsesOf(final Node name){
  return usages.getValuesForKey(name.getFullName());
}
Program: 59785
Project: 59785
Buggy source:
public Set<Field> getSettersOf(final NamedParameterNode<?> name){
  return setters.getValuesForKey(name);
}

Fixed version (ground truth):
public Set<Field> getSettersOf(final Node name){
  return setters.getValuesForKey(name);
}
Program: 59786
Project: 59786
Buggy source:
public String stripPrefixHelper(String s,String prefix){
  if (s.startsWith(prefix)) {
    return s.substring(prefix.length() + 1);
  }
 else {
    return s;
  }
}

Fixed version (ground truth):
public String stripPrefixHelper(String s,String prefix){
  if (!"String_Node_Str".equals(prefix) && s.startsWith(prefix)) {
    try {
      return s.substring(prefix.length() + 1);
    }
 catch (    StringIndexOutOfBoundsException e) {
      throw new RuntimeException("String_Node_Str" + prefix + "String_Node_Str"+ s,e);
    }
  }
 else {
    return s;
  }
}
Program: 59787
Project: 59787
Buggy source:
/** 
 * Process current edge of the injection plan.
 * @param aNodeFrom Current injection plan node.
 * @param aNodeTo Destination injection plan node.
 * @return true to proceed with the next node, false to cancel.
 */
@Override public boolean visit(final InjectionPlan<?> aNodeFrom,final InjectionPlan<?> aNodeTo){
  mGraphStr.append("String_Node_Str").append(aNodeFrom.getNode().getName()).append("String_Node_Str").append(aNodeTo.getNode().getName()).append("String_Node_Str");
  return true;
}

Fixed version (ground truth):
/** 
 * Process current edge of the injection plan.
 * @param aNodeFrom Current injection plan node.
 * @param aNodeTo Destination injection plan node.
 * @return true to proceed with the next node, false to cancel.
 */
@Override public boolean visit(final InjectionPlan<?> aNodeFrom,final InjectionPlan<?> aNodeTo){
  mGraphStr.append("String_Node_Str").append(aNodeFrom.getClass()).append('_').append(aNodeFrom.getNode().getName()).append("String_Node_Str").append(aNodeTo.getClass()).append('_').append(aNodeTo.getNode().getName()).append("String_Node_Str");
  return true;
}
Program: 59788
Project: 59788
Buggy source:
@Override protected String toInfeasibleInjectString(){
  if (alternatives.length == 1) {
    return alternatives[0].toInfeasibleInjectString();
  }
 else   if (alternatives.length == 0) {
    return "String_Node_Str" + this.getNode();
  }
 else   if (selectedIndex != -1) {
    return alternatives[selectedIndex].toInfeasibleInjectString();
  }
 else {
    throw new IllegalStateException("String_Node_Str" + toPrettyString());
  }
}

Fixed version (ground truth):
@Override protected String toInfeasibleInjectString(){
  if (alternatives.length == 1) {
    return alternatives[0].toInfeasibleInjectString();
  }
 else   if (alternatives.length == 0) {
    return "String_Node_Str" + this.getNode();
  }
 else   if (selectedIndex != -1) {
    return alternatives[selectedIndex].toInfeasibleInjectString();
  }
 else {
    return "String_Node_Str" + toPrettyString();
  }
}
Program: 59789
Project: 59789
Buggy source:
/** 
 * Get child elements of the injection plan tree. TODO: use ArrayList internally (and maybe for input, too).
 * @return A list of injection sub-plans.
 */
@Override public Collection<InjectionPlan<?>> getChildren(){
  return (Collection)Collections.unmodifiableList(Arrays.asList(this.alternatives));
}

Fixed version (ground truth):
/** 
 * Get child elements of the injection plan tree. TODO: use ArrayList internally (and maybe for input, too).
 * @return A list of injection sub-plans.
 */
@Override public Collection<InjectionPlan<?>> getChildren(){
  return (Collection)Collections.unmodifiableCollection(Arrays.asList(this.alternatives));
}
Program: 59790
Project: 59790
Buggy source:
public <T>ConfigurationModule set(Param<T> opt,String val){
  processSet(opt);
  setParams.put(opt,val);
  return this;
}

Fixed version (ground truth):
public final <T>ConfigurationModule set(Param<T> opt,String val){
  ConfigurationModule c=deepCopy();
  c.processSet(opt);
  c.setParams.put(opt,val);
  return c;
}
Program: 59791
Project: 59791
Buggy source:
public <T>ConfigurationModule bindImplementation(Class<T> iface,Impl<? extends T> opt){
  processUse(opt);
  freeImpls.put(opt,iface);
  return this;
}

Fixed version (ground truth):
public final <T>ConfigurationModule bindImplementation(Class<T> iface,Impl<? extends T> opt){
  ConfigurationModule c=deepCopy();
  c.processUse(opt);
  c.freeImpls.put(opt,iface);
  return c;
}
Program: 59792
Project: 59792
Buggy source:
public ConfigurationModule(){
  for (  Field f : getClass().getDeclaredFields()) {
    Class<?> t=f.getType();
    if (paramTypes.contains(t)) {
      if (!Modifier.isPublic(f.getModifiers())) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      if (!Modifier.isStatic(f.getModifiers())) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      if (!Modifier.isFinal(f.getModifiers())) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      final Object o;
      try {
        o=f.get(null);
      }
 catch (      IllegalArgumentException|IllegalAccessException e) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      if (map.containsKey(o)) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ map.get(o)+ "String_Node_Str"+ f);
      }
      if (t == RequiredImpl.class || t == RequiredParameter.class) {
        reqUse.add(f);
        reqSet.add(f);
      }
 else {
        optUse.add(f);
      }
      map.put(o,f);
    }
  }
}

Fixed version (ground truth):
public ConfigurationModule(){
  if (getClass().getEnclosingClass() == null) {
    throw new ClassHierarchyException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  for (  Field f : getClass().getEnclosingClass().getDeclaredFields()) {
    Class<?> t=f.getType();
    if (paramTypes.contains(t)) {
      if (!Modifier.isPublic(f.getModifiers())) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      if (!Modifier.isStatic(f.getModifiers())) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      if (!Modifier.isFinal(f.getModifiers())) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      final Object o;
      try {
        o=f.get(null);
      }
 catch (      IllegalArgumentException|IllegalAccessException e) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ f);
      }
      if (map.containsKey(o)) {
        throw new ClassHierarchyException("String_Node_Str" + getClass() + "String_Node_Str"+ map.get(o)+ "String_Node_Str"+ f);
      }
      if (t == RequiredImpl.class || t == RequiredParameter.class) {
        reqUse.add(f);
        reqSet.add(f);
      }
 else {
        optUse.add(f);
      }
      map.put(o,f);
    }
  }
}
Program: 59793
Project: 59793
Buggy source:
private <T>void processUse(Object impl){
  Field f=map.get(impl);
  if (f == null) {
  }
  reqUse.remove(f);
  optUse.remove(f);
}

Fixed version (ground truth):
private final <T>void processUse(Object impl){
  Field f=map.get(impl);
  if (f == null) {
  }
  reqUse.remove(f);
  optUse.remove(f);
}
Program: 59794
Project: 59794
Buggy source:
public <T>ConfigurationModule bindNamedParameter(Class<? extends Name<T>> iface,Impl<? extends T> opt){
  processUse(opt);
  freeImpls.put(opt,iface);
  return this;
}

Fixed version (ground truth):
public final <T>ConfigurationModule bindNamedParameter(Class<? extends Name<T>> iface,Impl<? extends T> opt){
  ConfigurationModule c=deepCopy();
  c.processUse(opt);
  c.freeImpls.put(opt,iface);
  return c;
}
Program: 59795
Project: 59795
Buggy source:
public <T>ConfigurationModule bind(Class<?> iface,Impl<?> opt){
  processUse(opt);
  freeImpls.put(opt,iface);
  return this;
}

Fixed version (ground truth):
public final <T>ConfigurationModule bind(Class<?> iface,Impl<?> opt){
  ConfigurationModule c=deepCopy();
  c.processUse(opt);
  c.freeImpls.put(opt,iface);
  return c;
}
Program: 59796
Project: 59796
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public Configuration build() throws BindException {
  if (!(reqUse.isEmpty() && optUse.isEmpty())) {
    throw new ClassHierarchyException("String_Node_Str" + reqUse + "String_Node_Str"+ optUse);
  }
  if (!reqSet.isEmpty()) {
    throw new BindException("String_Node_Str" + reqSet);
  }
  for (  Impl<?> i : setImpls.keySet()) {
    b.bind(freeImpls.get(i),setImpls.get(i));
  }
  for (  Param<?> p : setParams.keySet()) {
    b.bindNamedParameter((Class)freeParams.get(p),setParams.get(p));
  }
  return b.build();
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public final Configuration build() throws BindException {
  ConfigurationModule c=deepCopy();
  if (!(c.reqUse.isEmpty() && c.optUse.isEmpty())) {
    throw new ClassHierarchyException("String_Node_Str" + toString(c.reqUse) + "String_Node_Str"+ toString(c.optUse));
  }
  if (!c.reqSet.isEmpty()) {
    throw new BindException("String_Node_Str" + toString(c.reqSet));
  }
  for (  Impl<?> i : c.setImpls.keySet()) {
    c.b.bind(c.freeImpls.get(i),c.setImpls.get(i));
  }
  for (  Param<?> p : c.setParams.keySet()) {
    c.b.bindNamedParameter((Class)c.freeParams.get(p),c.setParams.get(p));
  }
  return c.b.build();
}
Program: 59797
Project: 59797
Buggy source:
public <T>ConfigurationModule bindSingletonImplementation(Class<T> iface,Impl<? extends T> opt) throws BindException {
  processUse(opt);
  try {
    b.bindSingleton(iface);
    freeImpls.put(opt,iface);
  }
 catch (  BindException e) {
    throw new RuntimeException(e);
  }
  return this;
}

Fixed version (ground truth):
public final <T>ConfigurationModule bindSingletonImplementation(Class<T> iface,Impl<? extends T> opt) throws BindException {
  ConfigurationModule c=deepCopy();
  c.processUse(opt);
  try {
    c.b.bindSingleton(iface);
    c.freeImpls.put(opt,iface);
  }
 catch (  BindException e) {
    throw new RuntimeException(e);
  }
  return c;
}
Program: 59798
Project: 59798
Buggy source:
public <T>ConfigurationModule bindSingleton(Class<T> iface){
  try {
    b.bindSingleton(iface);
  }
 catch (  BindException e) {
    throw new RuntimeException(e);
  }
  return this;
}

Fixed version (ground truth):
public final <T>ConfigurationModule bindSingleton(Class<T> iface){
  ConfigurationModule c=deepCopy();
  try {
    c.b.bindSingleton(iface);
  }
 catch (  BindException e) {
    throw new RuntimeException(e);
  }
  return c;
}
Program: 59799
Project: 59799
Buggy source:
public <T>ConfigurationModule bindConstructor(Class<T> c,Impl<? extends ExternalConstructor<? extends T>> v){
  processUse(v);
  freeImpls.put(v,c);
  return this;
}

Fixed version (ground truth):
public final <T>ConfigurationModule bindConstructor(Class<T> cons,Impl<? extends ExternalConstructor<? extends T>> v){
  ConfigurationModule c=deepCopy();
  c.processUse(v);
  c.freeImpls.put(v,cons);
  return c;
}
Program: 59800
Project: 59800
Buggy source:
private <T>void processSet(Object impl){
  Field f=map.get(impl);
  if (f == null) {
  }
  reqSet.remove(f);
}

Fixed version (ground truth):
private final <T>void processSet(Object impl){
  Field f=map.get(impl);
  if (f == null) {
  }
  reqSet.remove(f);
}
Program: 59801
Project: 59801
Buggy source:
/** 
 * Get child elements of the injection plan tree. By default, returns an empty list.
 * @return An empty list.
 */
@Override public Collection<InjectionPlan<?>> getChildren(){
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
/** 
 * Get child elements of the injection plan tree. By default, returns an empty list.
 * @return An empty list.
 */
@SuppressWarnings("String_Node_Str") @Override public Collection<InjectionPlan<?>> getChildren(){
  return Collections.EMPTY_LIST;
}
Program: 59802
Project: 59802
Buggy source:
/** 
 * Get child elements of the injection plan tree.
 * @return A list with single prerequisite injection plan.
 */
@Override public Collection<InjectionPlan<?>> getChildren(){
  return (Collection)Collections.singletonList(this.preReq);
}

Fixed version (ground truth):
/** 
 * Get child elements of the injection plan tree.
 * @return A list with single prerequisite injection plan.
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Collection<InjectionPlan<?>> getChildren(){
  return (Collection)Collections.singletonList(this.preReq);
}
Program: 59803
Project: 59803
Buggy source:
@Override protected String toInfeasibleInjectString(){
  if (alternatives.length == 1) {
    return alternatives[0].toInfeasibleInjectString();
  }
 else   if (alternatives.length == 0) {
    return "String_Node_Str" + this.getNode();
  }
 else   if (selectedIndex != -1) {
    return alternatives[selectedIndex].toInfeasibleInjectString();
  }
 else {
    throw new IllegalStateException("String_Node_Str" + toPrettyString());
  }
}

Fixed version (ground truth):
@Override protected String toInfeasibleInjectString(){
  if (alternatives.length == 1) {
    return alternatives[0].toInfeasibleInjectString();
  }
 else   if (alternatives.length == 0) {
    return "String_Node_Str" + this.getNode().getFullName();
  }
 else   if (selectedIndex != -1) {
    return alternatives[selectedIndex].toInfeasibleInjectString();
  }
 else {
    throw new IllegalStateException("String_Node_Str" + toPrettyString());
  }
}
Program: 59804
Project: 59804
Buggy source:
/** 
 * Get child elements of the injection plan tree. TODO: use ArrayList internally (and maybe for input, too).
 * @return A list of injection sub-plans.
 */
@Override public Collection<InjectionPlan<?>> getChildren(){
  return (Collection)Collections.unmodifiableList(Arrays.asList(this.alternatives));
}

Fixed version (ground truth):
/** 
 * Get child elements of the injection plan tree. TODO: use ArrayList internally (and maybe for input, too).
 * @return A list of injection sub-plans.
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Collection<InjectionPlan<?>> getChildren(){
  return (Collection)Collections.unmodifiableList(Arrays.asList(this.alternatives));
}
Program: 59805
Project: 59805
Buggy source:
/** 
 * Process current configuration node of NamedParameterNode type.
 * @param node Current configuration node.
 * @return true to proceed with the next node, false to cancel.
 */
public abstract boolean visit(NamedParameterNode node);

Fixed version (ground truth):
/** 
 * Process current configuration node of NamedParameterNode type.
 * @param node Current configuration node.
 * @return true to proceed with the next node, false to cancel.
 */
public abstract boolean visit(NamedParameterNode<?> node);
Program: 59807
Project: 59807
Buggy source:
@Override protected String toInfeasibleInjectString(){
  throw new IllegalArgumentException("String_Node_Str" + this.toString());
}

Fixed version (ground truth):
@Override protected String toInfeasibleInjectString(){
  return getNode() + "String_Node_Str";
}
Program: 59808
Project: 59808
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void testBindFromString() throws BindException, InjectionException {
  JavaConfigurationBuilder b=Tang.Factory.getTang().newConfigurationBuilder(IdentifierParser.class);
  b.bindNamedParameter(IdName.class,"String_Node_Str");
  Configuration c=b.build();
  String s=ConfigurationFile.toConfigurationString(c);
  JavaConfigurationBuilder b2=Tang.Factory.getTang().newConfigurationBuilder(IdentifierParser.class);
  ConfigurationFile.addConfiguration(b2,s);
  Configuration c2=b2.build();
  Assert.assertEquals("String_Node_Str",c2.getNamedParameter((NamedParameterNode<?>)c2.getClassHierarchy().getNode(ReflectionUtilities.getFullName(IdName.class))));
  Injector i=Tang.Factory.getTang().newInjector(c2);
  Assert.assertEquals("String_Node_Str",i.getNamedInstance(IdName.class).toString());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testBindFromString() throws BindException, InjectionException {
  JavaConfigurationBuilder b=Tang.Factory.getTang().newConfigurationBuilder(IdentifierParser.class);
  b.bindNamedParameter(IdName.class,"String_Node_Str");
  Configuration c=b.build();
  String s=ConfigurationFile.toConfigurationString(c);
  JavaConfigurationBuilder b2=Tang.Factory.getTang().newConfigurationBuilder(IdentifierParser.class);
  ConfigurationFile.addConfiguration(b2,s);
  Configuration c2=b2.build();
  Assert.assertEquals("String_Node_Str",c2.getNamedParameter((NamedParameterNode<?>)c2.getClassHierarchy().getNode(ReflectionUtilities.getFullName(IdName.class))));
  Injector i=Tang.Factory.getTang().newInjector(c2);
  Assert.assertEquals("String_Node_Str",i.getNamedInstance(IdName.class).toString());
  Assert.assertTrue(i.getNamedInstance(IdName.class) instanceof BIdentifier);
}
Program: 59809
Project: 59809
Buggy source:
/** 
 * @param aArgs command line arguments.
 * @throws BindException configuration error.
 * @throws InjectionException configuration error.
 * @throws IOException cannot process command line parameters.
 */
public static void main(final String[] aArgs) throws BindException, InjectionException, IOException {
  final Tang tang=Tang.Factory.getTang();
  final ConfigurationBuilder confBuilder=tang.newConfigurationBuilder();
  new CommandLine(confBuilder).processCommandLine(aArgs);
  final Configuration config=confBuilder.build();
  final Injector injector=tang.newInjector(config);
  final PrintTypeHierarchy myself=injector.getInstance(PrintTypeHierarchy.class);
  final GraphVisitorGraphviz visitor=new GraphVisitorGraphviz(config);
  Walk.preorder(visitor,visitor,config);
  System.out.println(visitor);
  System.out.println(myself);
  System.out.println(ConfigurationFile.toConfigurationString(config));
}

Fixed version (ground truth):
/** 
 * @param aArgs command line arguments.
 * @throws BindException configuration error.
 * @throws InjectionException configuration error.
 * @throws IOException cannot process command line parameters.
 */
public static void main(final String[] aArgs) throws BindException, InjectionException, IOException {
  final Tang tang=Tang.Factory.getTang();
  final ConfigurationBuilder confBuilder=tang.newConfigurationBuilder();
  new CommandLine(confBuilder).processCommandLine(aArgs);
  final Configuration config=confBuilder.build();
  final Injector injector=tang.newInjector(config);
  final PrintTypeHierarchy myself=injector.getInstance(PrintTypeHierarchy.class);
  final GraphVisitorGraphviz visitor=new GraphVisitorGraphviz(config);
  Walk.preorder(visitor,visitor,config);
  System.out.println(visitor);
}
Program: 59811
Project: 59811
Buggy source:
private static void newline(StringBuffer pretty,int indent){
  pretty.append('\n');
  for (int j=0; j < indent * 3; j++) {
    pretty.append(' ');
  }
}

Fixed version (ground truth):
private static void newline(StringBuffer pretty,int indent){
  pretty.append('\n');
  for (int j=0; j < indent * 2; j++) {
    pretty.append(' ');
  }
}
Program: 59812
Project: 59812
Buggy source:
public String toPrettyString(){
  String ugly=node.getFullName() + "String_Node_Str" + toString();
  StringBuffer pretty=new StringBuffer();
  int currentIndent=0;
  for (int i=0; i < ugly.length(); i++) {
    char c=ugly.charAt(i);
    if (c == '[') {
      currentIndent++;
      pretty.append(c);
      newline(pretty,currentIndent);
    }
 else     if (c == ']') {
      currentIndent--;
      pretty.append(c);
    }
 else     if (c == '|') {
      newline(pretty,currentIndent);
      pretty.append(c);
    }
 else {
      pretty.append(c);
    }
  }
  return pretty.toString();
}

Fixed version (ground truth):
public String toPrettyString(){
  String ugly=node.getFullName() + "String_Node_Str" + toString();
  StringBuffer pretty=new StringBuffer();
  int currentIndent=1;
  for (int i=0; i < ugly.length(); i++) {
    char c=ugly.charAt(i);
    if (c == '(') {
      if (ugly.charAt(i + 1) == ')') {
        pretty.append("String_Node_Str");
        i++;
      }
 else {
        newline(pretty,currentIndent);
        currentIndent++;
        pretty.append(c);
        pretty.append(' ');
      }
    }
 else     if (c == '[') {
      if (ugly.charAt(i + 1) == ']') {
        pretty.append("String_Node_Str");
        i++;
      }
 else {
        newline(pretty,currentIndent);
        currentIndent++;
        pretty.append(c);
        pretty.append(' ');
      }
    }
 else     if (c == ')' || c == ']') {
      currentIndent--;
      newline(pretty,currentIndent);
      pretty.append(c);
    }
 else     if (c == '|') {
      newline(pretty,currentIndent);
      pretty.append(c);
    }
 else     if (c == ',') {
      currentIndent--;
      newline(pretty,currentIndent);
      pretty.append(c);
      currentIndent++;
    }
 else {
      pretty.append(c);
    }
  }
  return pretty.toString();
}
Program: 59813
Project: 59813
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  if (this.alternatives.length == 0) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append(alternatives[0]);
  }
  for (int i=1; i < alternatives.length; i++) {
    sb.append("String_Node_Str" + alternatives[i]);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  if (alternatives.length == 1) {
    return getNode().getName() + "String_Node_Str" + alternatives[0];
  }
 else   if (alternatives.length == 0) {
    return getNode().getName() + "String_Node_Str";
  }
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(getNode().getName() + "String_Node_Str" + alternatives[0]);
  for (int i=1; i < alternatives.length; i++) {
    sb.append("String_Node_Str" + alternatives[i]);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 59816
Project: 59816
Buggy source:
NamedParameterNode(Node parent,Class<? extends Name<T>> clazz,Class<T> argClass) throws BindException {
  super(parent,clazz);
  this.clazz=clazz;
  this.namedParameter=clazz.getAnnotation(NamedParameter.class);
  this.argClass=argClass;
  if (this.namedParameter == null || namedParameter.default_value().length() == 0) {
    this.defaultInstance=null;
  }
 else {
    this.defaultInstance=ReflectionUtilities.parse(this.argClass,namedParameter.default_value());
  }
}

Fixed version (ground truth):
NamedParameterNode(Node parent,Class<? extends Name<T>> clazz,Class<T> argClass) throws BindException {
  super(parent,clazz);
  this.clazz=clazz;
  this.namedParameter=clazz.getAnnotation(NamedParameter.class);
  this.argClass=argClass;
  if (this.namedParameter == null || namedParameter.default_value().length() == 0) {
    this.defaultInstance=null;
  }
 else {
    try {
      this.defaultInstance=ReflectionUtilities.parse(this.argClass,namedParameter.default_value());
    }
 catch (    UnsupportedOperationException e) {
      throw new BindException("String_Node_Str" + clazz.getName() + "String_Node_Str"+ namedParameter.default_value()+ "String_Node_Str",e);
    }
  }
}
Program: 59817
Project: 59817
Buggy source:
public Constructor(TypeHierarchy.ConstructorDef<T> constructor,InjectionPlan<?>[] args){
  this.constructor=constructor;
  this.args=args;
  int numAlternatives=1;
  boolean isAmbiguous=false;
  boolean isInjectable=true;
  for (  InjectionPlan<?> a : args) {
    numAlternatives*=a.getNumAlternatives();
    if (a.isAmbiguous())     isAmbiguous=true;
    if (!a.isInjectable())     isInjectable=false;
  }
  this.numAlternatives=numAlternatives;
  this.isAmbiguous=isAmbiguous;
  this.isInjectable=isInjectable;
}

Fixed version (ground truth):
public Constructor(ClassNode<T> cn,TypeHierarchy.ConstructorDef<T> constructor,InjectionPlan<?>[] args){
  this.constructor=constructor;
  this.args=args;
  int numAlternatives=1;
  boolean isAmbiguous=false;
  boolean isInjectable=true;
  for (  InjectionPlan<?> a : args) {
    numAlternatives*=a.getNumAlternatives();
    if (a.isAmbiguous())     isAmbiguous=true;
    if (!a.isInjectable())     isInjectable=false;
  }
  this.numAlternatives=numAlternatives;
  this.isAmbiguous=isAmbiguous;
  this.isInjectable=isInjectable;
  this.cn=cn;
}
Program: 59818
Project: 59818
Buggy source:
private void populateSingletons() throws InjectionException {
  if (!populated) {
    populated=true;
    for (    ClassNode<?> cn : tc.singletons) {
      if (!tc.singletonInstances.containsKey(cn)) {
        Object o=getInstance(cn.getClazz());
        tc.singletonInstances.put(cn,o);
      }
    }
  }
}

Fixed version (ground truth):
private void populateSingletons() throws InjectionException {
  if (!populated) {
    populated=true;
    boolean stillHope=true;
    boolean allSucceeded=false;
    while (!allSucceeded) {
      boolean oneSucceeded=false;
      allSucceeded=true;
      for (      ClassNode<?> cn : tc.singletons) {
        if (!tc.singletonInstances.containsKey(cn)) {
          try {
            getInstance(cn.getClazz());
            System.err.println("String_Node_Str" + cn);
            oneSucceeded=true;
          }
 catch (          SingletonInjectionException e) {
            System.err.println("String_Node_Str" + cn);
            allSucceeded=false;
            if (!stillHope) {
              throw e;
            }
          }
        }
      }
      if (!oneSucceeded) {
        stillHope=false;
      }
    }
  }
}
Program: 59821
Project: 59821
Buggy source:
/** 
 * Force Tang to treat the specified constructor as though it had an @Inject annotation.
 * @param c The class the constructor instantiates.
 * @param args The arguments taken by the constructor, in declaration order.
 */
public <T>void registerLegacyConstructor(Class<?> c,Class<?>... args) throws BindException ;

Fixed version (ground truth):
/** 
 * Force Tang to treat the specified constructor as though it had an @Inject annotation.
 * @param c The class the constructor instantiates.
 * @param args The arguments taken by the constructor, in declaration order.
 */
public <T>void registerLegacyConstructor(Class<T> c,Class<?>... args) throws BindException ;
Program: 59823
Project: 59823
Buggy source:
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public <T>void bindConstructor(Class<T> c,Class<? extends ExternalConstructor<? extends T>> v) throws BindException {
  try {
    conf.boundConstructors.put((ClassNode<?>)conf.namespace.register(c),(Class)v);
  }
 catch (  ClassCastException e) {
    throw new IllegalArgumentException("String_Node_Str" + c + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public <T>void bindConstructor(Class<T> c,Class<? extends ExternalConstructor<? extends T>> v) throws BindException {
  conf.namespace.register(v);
  try {
    conf.boundConstructors.put((ClassNode<?>)conf.namespace.register(c),(Class)v);
  }
 catch (  ClassCastException e) {
    throw new IllegalArgumentException("String_Node_Str" + c + "String_Node_Str");
  }
}
Program: 59824
Project: 59824
Buggy source:
@Override public <T>void registerLegacyConstructor(Class<?> c,Class<?>... args) throws BindException {
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public <T>void registerLegacyConstructor(Class<T> c,final Class<?>... args) throws BindException {
  @SuppressWarnings("String_Node_Str") ClassNode<T> cn=(ClassNode<T>)conf.namespace.register(c);
  conf.legacyConstructors.put(cn,cn.createConstructorDef(args));
}
Program: 59828
Project: 59828
Buggy source:
private boolean isInjectionCandidate(Class<?> clazz){
  final boolean injectable;
  if (clazz.isLocalClass() || clazz.isMemberClass()) {
    if (!Modifier.isStatic(clazz.getModifiers())) {
      injectable=false;
    }
 else {
      injectable=true;
    }
  }
 else {
    injectable=true;
  }
  return injectable;
}

Fixed version (ground truth):
public boolean isInjectionCandidate(){
  final boolean injectable;
  if (clazz.isLocalClass() || clazz.isMemberClass()) {
    if (!Modifier.isStatic(clazz.getModifiers())) {
      injectable=false;
    }
 else {
      injectable=true;
    }
  }
 else {
    injectable=true;
  }
  return injectable;
}
Program: 59829
Project: 59829
Buggy source:
/** 
 * Obtain the effective configuration of this ConfigurationBuilderImpl instance. This consists of string-string pairs that could be dumped directly to a Properties file, for example. Currently, this method does not return information about default parameter values that were specified by parameter annotations, or about the auto-discovered stuff in TypeHierarchy. All of that should be automatically imported as these keys are parsed on the other end.
 * @return a String to String map
 */
public Map<String,String> getConfiguration(){
  if (dirtyBit) {
    throw new IllegalStateException("String_Node_Str");
  }
  Map<String,String> ret=new HashMap<String,String>();
  for (  Class<?> opt : namespace.getRegisteredClasses()) {
    try {
      Node n=namespace.getNode(opt);
      if (n instanceof NamedParameterNode) {
        ret.put(opt.getName(),REGISTERED);
      }
    }
 catch (    NameResolutionException e) {
      throw new IllegalStateException("String_Node_Str",e);
    }
  }
  for (  Node opt : boundImpls.keySet()) {
    ret.put(opt.getFullName(),boundImpls.get(opt).getName());
  }
  for (  Node opt : boundConstructors.keySet()) {
    ret.put(opt.getFullName(),boundConstructors.get(opt).getName());
  }
  for (  Node opt : namedParameters.keySet()) {
    ret.put(opt.getFullName(),namedParameters.get(opt));
  }
  for (  Node opt : singletons) {
    ret.put(opt.getFullName(),SINGLETON);
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Obtain the effective configuration of this ConfigurationBuilderImpl instance. This consists of string-string pairs that could be dumped directly to a Properties file, for example. Currently, this method does not return information about default parameter values that were specified by parameter annotations, or about the auto-discovered stuff in TypeHierarchy. All of that should be automatically imported as these keys are parsed on the other end.
 * @return a String to String map
 */
private Map<String,String> getConfiguration(){
  if (dirtyBit) {
    throw new IllegalStateException("String_Node_Str");
  }
  Map<String,String> ret=new HashMap<String,String>();
  for (  Class<?> opt : namespace.getRegisteredClasses()) {
    try {
      Node n=namespace.getNode(opt);
      if (n instanceof NamedParameterNode) {
        ret.put(opt.getName(),REGISTERED);
      }
    }
 catch (    NameResolutionException e) {
      throw new IllegalStateException("String_Node_Str",e);
    }
  }
  for (  Node opt : boundImpls.keySet()) {
    ret.put(opt.getFullName(),boundImpls.get(opt).getName());
  }
  for (  Node opt : boundConstructors.keySet()) {
    ret.put(opt.getFullName(),boundConstructors.get(opt).getName());
  }
  for (  Node opt : namedParameters.keySet()) {
    ret.put(opt.getFullName(),namedParameters.get(opt));
  }
  for (  Node opt : singletons) {
    ret.put(opt.getFullName(),SINGLETON);
  }
  return ret;
}
Program: 59830
Project: 59830
Buggy source:
@Override public void writeConfigurationFile(OutputStream o){
  PrintStream s=new PrintStream(o);
  if (dirtyBit) {
    throw new IllegalStateException("String_Node_Str");
  }
  Map<String,String> effectiveConfiguration=getConfiguration();
  for (  String k : effectiveConfiguration.keySet()) {
    s.println(k + "String_Node_Str" + effectiveConfiguration.get(k));
  }
}

Fixed version (ground truth):
@Override public void writeConfigurationFile(OutputStream o){
  PrintStream s=new PrintStream(o);
  if (dirtyBit) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (  Class<?> opt : namespace.getRegisteredClasses()) {
    try {
      Node n=namespace.getNode(opt);
      if (n instanceof NamedParameterNode) {
        s.println(opt.getName() + "String_Node_Str" + REGISTERED);
      }
    }
 catch (    NameResolutionException e) {
      throw new IllegalStateException("String_Node_Str",e);
    }
  }
  for (  Node opt : boundImpls.keySet()) {
    s.println(opt.getFullName() + "String_Node_Str" + boundImpls.get(opt).getName());
  }
  for (  Node opt : boundConstructors.keySet()) {
    s.println(opt.getFullName() + "String_Node_Str" + boundConstructors.get(opt).getName());
  }
  for (  Node opt : namedParameters.keySet()) {
    s.println(opt.getFullName() + "String_Node_Str" + namedParameters.get(opt));
  }
  for (  Node opt : singletons) {
    s.println(opt.getFullName() + "String_Node_Str" + SINGLETON);
  }
}
Program: 59831
Project: 59831
Buggy source:
ConstructorDef(ConstructorArg[] args,Constructor<T> constructor) throws BindException {
  this.args=args;
  this.constructor=constructor;
  constructor.setAccessible(true);
  for (int i=0; i < this.args.length; i++) {
    for (int j=i + 1; j < this.args.length; j++) {
      if (this.args[i].toString().equals(this.args[j].toString())) {
        throw new BindException("String_Node_Str" + "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
ConstructorDef(ConstructorArg[] args,Constructor<T> constructor) throws BindException {
  this.args=args;
  this.constructor=constructor;
  constructor.setAccessible(true);
  for (int i=0; i < this.args.length; i++) {
    for (int j=i + 1; j < this.args.length; j++) {
      if (this.args[i].equals(this.args[j])) {
        throw new BindException("String_Node_Str" + "String_Node_Str" + constructor);
      }
    }
  }
}
Program: 59833
Project: 59833
Buggy source:
String getFullName(){
  if (parent == null) {
    return name;
  }
 else {
    return parent.getFullName() + "String_Node_Str" + name;
  }
}

Fixed version (ground truth):
String getFullName(){
  if (parent == null) {
    return name;
  }
 else {
    String parentName=parent.getFullName();
    if (parentName.length() == 0) {
      return name;
    }
 else {
      return parent.getFullName() + "String_Node_Str" + name;
    }
  }
}
Program: 59835
Project: 59835
Buggy source:
Node(Node parent,String name){
  this.parent=parent;
  this.name=name;
  if (parent != null) {
    parent.put(this);
  }
}

Fixed version (ground truth):
Node(Node parent,String name){
  this.parent=parent;
  this.name=name;
  if (parent != null) {
    if (name.length() == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    parent.put(this);
  }
}
Program: 59836
Project: 59836
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private <T>NamespaceNode<T> registerNamespace(Namespace conf,ClassNode<T> classNode) throws BindException {
  String[] path=conf.value().split(regexp);
  Node root=namespace;
  for (int i=0; i < path.length - 1; i++) {
    if (!root.contains(path[i])) {
      Node newRoot=new NamespaceNode<T>(root,path[i]);
      root=newRoot;
    }
 else {
      root=root.get(path[i]);
      if (!(root instanceof NamespaceNode)) {
        throw new BindException("String_Node_Str" + root + "String_Node_Str");
      }
    }
  }
  if (root instanceof NamespaceNode) {
    Node target=((NamespaceNode<?>)root).getTarget();
    if (target != null) {
      throw new BindException("String_Node_Str");
    }
  }
  Node n=root.get(path[path.length - 1]);
  NamespaceNode<T> ret;
  if (n == null) {
    ret=new NamespaceNode<T>(root,path[path.length - 1],classNode);
  }
 else   if (n instanceof NamespaceNode) {
    ret=(NamespaceNode<T>)n;
    ret.setTarget(classNode);
    for (    Node child : ret.children.values()) {
      if (true) {
        throw new BindException("String_Node_Str");
      }
 else {
        try {
          classNode.put(child);
        }
 catch (        IllegalArgumentException e) {
          throw new BindException("String_Node_Str" + ret.getFullName() + "String_Node_Str"+ child.getFullName());
        }
      }
    }
  }
 else {
    throw new BindException("String_Node_Str" + n + "String_Node_Str");
  }
  return ret;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private <T>NamespaceNode<T> registerNamespace(Namespace conf,ClassNode<T> classNode) throws BindException {
  String[] path=conf.value().split(ReflectionUtilities.regexp);
  Node root=namespace;
  for (int i=0; i < path.length - 1; i++) {
    if (!root.contains(path[i])) {
      Node newRoot=new NamespaceNode<T>(root,path[i]);
      root=newRoot;
    }
 else {
      root=root.get(path[i]);
      if (!(root instanceof NamespaceNode)) {
        throw new BindException("String_Node_Str" + root + "String_Node_Str");
      }
    }
  }
  if (root instanceof NamespaceNode) {
    Node target=((NamespaceNode<?>)root).getTarget();
    if (target != null) {
      throw new BindException("String_Node_Str");
    }
  }
  Node n=root.get(path[path.length - 1]);
  NamespaceNode<T> ret;
  if (n == null) {
    ret=new NamespaceNode<T>(root,path[path.length - 1],classNode);
  }
 else   if (n instanceof NamespaceNode) {
    ret=(NamespaceNode<T>)n;
    ret.setTarget(classNode);
    for (    Node child : ret.children.values()) {
      if (true) {
        throw new BindException("String_Node_Str");
      }
 else {
        try {
          classNode.put(child);
        }
 catch (        IllegalArgumentException e) {
          throw new BindException("String_Node_Str" + ret.getFullName() + "String_Node_Str"+ child.getFullName());
        }
      }
    }
  }
 else {
    throw new BindException("String_Node_Str" + n + "String_Node_Str");
  }
  return ret;
}
Program: 59837
Project: 59837
Buggy source:
@SuppressWarnings("String_Node_Str") NamedParameterNode(Node parent,Class<? extends Name<T>> clazz,Class<T> argClass) throws BindException {
  super(parent,clazz);
  this.clazz=clazz;
  this.namedParameter=clazz.getAnnotation(NamedParameter.class);
  this.argClass=argClass;
  if (this.namedParameter == null || namedParameter.default_value().length() == 0) {
    this.defaultInstance=null;
  }
 else {
    this.defaultInstance=ReflectionUtilities.parse(this.argClass,namedParameter.default_value());
  }
}

Fixed version (ground truth):
NamedParameterNode(Node parent,Class<? extends Name<T>> clazz,Class<T> argClass) throws BindException {
  super(parent,clazz);
  this.clazz=clazz;
  this.namedParameter=clazz.getAnnotation(NamedParameter.class);
  this.argClass=argClass;
  if (this.namedParameter == null || namedParameter.default_value().length() == 0) {
    this.defaultInstance=null;
  }
 else {
    this.defaultInstance=ReflectionUtilities.parse(this.argClass,namedParameter.default_value());
  }
}
Program: 59838
Project: 59838
Buggy source:
private <T,U>Node buildPathToNode(Class<U> clazz,boolean isPrefixTarget) throws BindException {
  String[] path=clazz.getName().split(regexp);
  Node root=namespace;
  for (int i=0; i < path.length - 1; i++) {
    root=root.get(path[i]);
  }
  if (root == null) {
    throw new NullPointerException();
  }
  Node parent=root;
  Class<?> argType=getNamedParameterTargetOrNull(clazz);
  if (argType == null) {
    return new ClassNode<U>(parent,clazz,isPrefixTarget,false);
  }
 else {
    if (isPrefixTarget) {
      throw new BindException(clazz + "String_Node_Str");
    }
    @SuppressWarnings("String_Node_Str") NamedParameterNode<T> np=new NamedParameterNode<T>(parent,(Class<? extends Name<T>>)clazz,(Class<T>)argType);
    String shortName=np.getShortName();
    if (shortName != null) {
      NamedParameterNode<?> oldNode=shortNames.get(shortName);
      if (oldNode != null) {
        if (oldNode.getNameClass() == np.getNameClass()) {
          throw new IllegalStateException("String_Node_Str" + oldNode.getNameClass() + "String_Node_Str"+ shortName);
        }
        throw new BindException("String_Node_Str" + oldNode.getNameClass() + "String_Node_Str"+ np.getNameClass()+ "String_Node_Str"+ shortName);
      }
      shortNames.put(shortName,np);
    }
    return np;
  }
}

Fixed version (ground truth):
private <T,U>Node buildPathToNode(Class<U> clazz,boolean isPrefixTarget) throws BindException {
  String[] path=clazz.getName().split(ReflectionUtilities.regexp);
  Node root=namespace;
  for (int i=0; i < path.length - 1; i++) {
    root=root.get(path[i]);
  }
  if (root == null) {
    throw new NullPointerException();
  }
  Node parent=root;
  Class<?> argType=getNamedParameterTargetOrNull(clazz);
  if (argType == null) {
    return new ClassNode<U>(parent,clazz,isPrefixTarget,false);
  }
 else {
    if (isPrefixTarget) {
      throw new BindException(clazz + "String_Node_Str");
    }
    @SuppressWarnings("String_Node_Str") NamedParameterNode<T> np=new NamedParameterNode<T>(parent,(Class<? extends Name<T>>)clazz,(Class<T>)argType);
    String shortName=np.getShortName();
    if (shortName != null) {
      NamedParameterNode<?> oldNode=shortNames.get(shortName);
      if (oldNode != null) {
        if (oldNode.getNameClass() == np.getNameClass()) {
          throw new IllegalStateException("String_Node_Str" + oldNode.getNameClass() + "String_Node_Str"+ shortName);
        }
        throw new BindException("String_Node_Str" + oldNode.getNameClass() + "String_Node_Str"+ np.getNameClass()+ "String_Node_Str"+ shortName);
      }
      shortNames.put(shortName,np);
    }
    return np;
  }
}