Program: 23040
Project: 23040
Buggy source:
@Override public BindingResolution resolveBinding(StructureDefinition profile,ElementDefinitionBindingComponent binding,String path){
  BindingResolution br=new BindingResolution();
  if (!binding.hasValueSet()) {
    br.url=specPath("String_Node_Str");
    br.display="String_Node_Str";
  }
 else   if (binding.getValueSet() instanceof UriType) {
    String ref=((UriType)binding.getValueSet()).getValue();
    if (ref.startsWith("String_Node_Str")) {
      br.url=specPath("String_Node_Str" + ref.substring(26) + "String_Node_Str");
      br.display=ref.substring(26);
    }
 else {
      ValueSet vs=context.fetchResource(ValueSet.class,ref);
      if (vs != null) {
        br.url=vs.getUserString("String_Node_Str");
        br.display=vs.getName();
      }
 else {
        br.url=ref;
        if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         br.display=ref;
      }
    }
  }
 else {
    String ref=((Reference)binding.getValueSet()).getReference();
    if (ref.startsWith("String_Node_Str")) {
      ValueSet vs=context.fetchResource(ValueSet.class,makeCanonical(ref));
      if (vs == null) {
        br.url=ref.substring(9) + "String_Node_Str";
        br.display=ref.substring(9);
        brokenLinkWarning(path,ref);
      }
 else {
        br.url=vs.getUserString("String_Node_Str");
        br.display=vs.getName();
      }
    }
 else {
      if (ref.startsWith("String_Node_Str")) {
        ValueSet vs=context.fetchResource(ValueSet.class,ref);
        if (vs != null) {
          br.url=vs.getUserString("String_Node_Str");
          br.display=vs.getName();
        }
 else {
          br.display=ref.substring(29);
          br.url=ref.substring(29) + "String_Node_Str";
          brokenLinkWarning(path,ref);
        }
      }
 else       if (ref.startsWith("String_Node_Str")) {
        br.url=specPath("String_Node_Str" + ref.substring(26) + "String_Node_Str");
        br.display=ref.substring(26);
      }
 else       if (ref.startsWith("String_Node_Str")) {
        br.url=specPath("String_Node_Str" + ref.substring(26) + "String_Node_Str");
        br.display=ref.substring(26);
      }
 else       if (ref.startsWith("String_Node_Str")) {
        String code=tail(ref);
        if (code.startsWith("String_Node_Str")) {
          br.url="String_Node_Str" + code + "String_Node_Str";
          br.display="String_Node_Str" + code;
        }
 else {
          br.url="String_Node_Str" + code + "String_Node_Str";
          br.display="String_Node_Str" + code;
        }
      }
 else {
        ValueSet vs=context.fetchResource(ValueSet.class,ref);
        if (vs == null) {
          br.url=ref + "String_Node_Str";
          br.display=ref;
          brokenLinkWarning(path,ref);
        }
 else         if (ref.contains("String_Node_Str")) {
          br.url=vs.getUserString("String_Node_Str");
          if (br.url == null) {
            System.out.println("String_Node_Str" + ref);
            br.url=vs.getUserString("String_Node_Str");
          }
          br.display=vs.getName();
        }
 else {
          br.url=vs.getUserString("String_Node_Str");
          br.display=vs.getName();
        }
      }
    }
  }
  return br;
}

Fixed version (ground truth):
@Override public BindingResolution resolveBinding(StructureDefinition profile,ElementDefinitionBindingComponent binding,String path){
  BindingResolution br=new BindingResolution();
  if (!binding.hasValueSet()) {
    br.url=specPath("String_Node_Str");
    br.display="String_Node_Str";
  }
 else   if (binding.getValueSet() instanceof CanonicalType) {
    String ref=((CanonicalType)binding.getValueSet()).asStringValue();
    if (ref.startsWith("String_Node_Str")) {
      ValueSet vs=context.fetchResource(ValueSet.class,makeCanonical(ref));
      if (vs == null) {
        br.url=ref.substring(9) + "String_Node_Str";
        br.display=ref.substring(9);
        brokenLinkWarning(path,ref);
      }
 else {
        br.url=vs.getUserString("String_Node_Str");
        br.display=vs.getName();
      }
    }
 else {
      if (ref.startsWith("String_Node_Str")) {
        ValueSet vs=context.fetchResource(ValueSet.class,ref);
        if (vs != null) {
          br.url=vs.getUserString("String_Node_Str");
          br.display=vs.getName();
        }
 else {
          br.display=ref.substring(29);
          br.url=ref.substring(29) + "String_Node_Str";
          brokenLinkWarning(path,ref);
        }
      }
 else       if (ref.startsWith("String_Node_Str")) {
        br.url=specPath("String_Node_Str" + ref.substring(26) + "String_Node_Str");
        br.display=ref.substring(26);
      }
 else       if (ref.startsWith("String_Node_Str")) {
        br.url=specPath("String_Node_Str" + ref.substring(26) + "String_Node_Str");
        br.display=ref.substring(26);
      }
 else       if (ref.startsWith("String_Node_Str")) {
        String code=tail(ref);
        if (code.startsWith("String_Node_Str")) {
          br.url="String_Node_Str" + code + "String_Node_Str";
          br.display="String_Node_Str" + code;
        }
 else {
          br.url="String_Node_Str" + code + "String_Node_Str";
          br.display="String_Node_Str" + code;
        }
      }
 else {
        ValueSet vs=context.fetchResource(ValueSet.class,ref);
        if (vs == null) {
          br.url=ref + "String_Node_Str";
          br.display=ref;
          brokenLinkWarning(path,ref);
        }
 else         if (ref.contains("String_Node_Str")) {
          br.url=vs.getUserString("String_Node_Str");
          if (br.url == null) {
            System.out.println("String_Node_Str" + ref);
            br.url=vs.getUserString("String_Node_Str");
          }
          br.display=vs.getName();
        }
 else {
          br.url=vs.getUserString("String_Node_Str");
          br.display=vs.getName();
        }
      }
    }
  }
 else   if (binding.getValueSet() instanceof UriType) {
    String ref=((UriType)binding.getValueSet()).getValue();
    if (ref.startsWith("String_Node_Str")) {
      br.url=specPath("String_Node_Str" + ref.substring(26) + "String_Node_Str");
      br.display=ref.substring(26);
    }
 else {
      ValueSet vs=context.fetchResource(ValueSet.class,ref);
      if (vs != null) {
        br.url=vs.getUserString("String_Node_Str");
        br.display=vs.getName();
      }
 else {
        br.url=ref;
        if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         if (ref.equals("String_Node_Str"))         br.display="String_Node_Str";
 else         br.display=ref;
      }
    }
  }
  return br;
}