Program: 112238
Project: 112238
Buggy source:
private Cell generateDescription(HierarchicalTableGenerator gen,Row row,ElementDefinition definition,ElementDefinition fallback,boolean used,String baseURL,String url,StructureDefinition profile,String corePath,boolean root,boolean logicalModel) throws IOException {
  Cell c=gen.new Cell();
  row.getCells().add(c);
  if (used) {
    if (logicalModel && ToolingExtensions.hasExtension(profile,"String_Node_Str")) {
      if (root) {
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,ToolingExtensions.readStringExtension(profile,"String_Node_Str"),null));
      }
 else       if (!root && ToolingExtensions.hasExtension(definition,"String_Node_Str") && !ToolingExtensions.readStringExtension(definition,"String_Node_Str").equals(ToolingExtensions.readStringExtension(profile,"String_Node_Str"))) {
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,ToolingExtensions.readStringExtension(definition,"String_Node_Str"),null));
      }
    }
    if (definition.hasContentReference()) {
      ElementDefinition ed=getElementByName(profile.getSnapshot().getElement(),definition.getContentReference());
      if (ed == null)       c.getPieces().add(gen.new Piece(null,"String_Node_Str" + definition.getContentReference(),null));
 else       c.getPieces().add(gen.new Piece("String_Node_Str" + ed.getPath(),"String_Node_Str" + ed.getPath(),null));
    }
    if (definition.getPath().endsWith("String_Node_Str") && definition.hasFixed()) {
      c.getPieces().add(checkForNoChange(definition.getFixed(),gen.new Piece(null,"String_Node_Str" + buildJson(definition.getFixed()) + "String_Node_Str",null).addStyle("String_Node_Str")));
    }
 else {
      if (definition != null && definition.hasShort()) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        c.addPiece(checkForNoChange(definition.getShortElement(),gen.new Piece(null,definition.getShort(),null)));
      }
 else       if (fallback != null && fallback != null && fallback.hasShort()) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        c.addPiece(checkForNoChange(fallback.getShortElement(),gen.new Piece(null,fallback.getShort(),null)));
      }
      if (url != null) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        String fullUrl=url.startsWith("String_Node_Str") ? baseURL + url : url;
        StructureDefinition ed=context.fetchResource(StructureDefinition.class,url);
        String ref=ed == null ? null : (String)corePath + ed.getUserData("String_Node_Str");
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(ref,fullUrl,null));
      }
      if (definition.hasSlicing()) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,describeSlice(definition.getSlicing()),null));
      }
      if (definition != null) {
        if (definition.hasBinding()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          BindingResolution br=pkp.resolveBinding(definition.getBinding());
          c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) ? br.url : corePath + br.url,br.display,null)));
          if (definition.getBinding().hasStrength()) {
            c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(null,"String_Node_Str",null)));
            c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(corePath + "String_Node_Str" + definition.getBinding().getStrength().toCode(),definition.getBinding().getStrength().toCode(),definition.getBinding().getStrength().getDefinition())));
            c.getPieces().add(gen.new Piece(null,"String_Node_Str",null));
          }
        }
        for (        ElementDefinitionConstraintComponent inv : definition.getConstraint()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(inv,gen.new Piece(null,inv.getKey() + "String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(inv,gen.new Piece(null,inv.getHuman(),null)));
        }
        if (definition.hasFixed()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(definition.getFixed(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getFixed(),gen.new Piece(null,buildJson(definition.getFixed()),null).addStyle("String_Node_Str")));
        }
 else         if (definition.hasPattern()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(definition.getPattern(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getPattern(),gen.new Piece(null,buildJson(definition.getPattern()),null).addStyle("String_Node_Str")));
        }
 else         if (definition.hasExample()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(definition.getExample(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getExample(),gen.new Piece(null,buildJson(definition.getExample()),null).addStyle("String_Node_Str")));
        }
      }
    }
  }
  return c;
}

Fixed version (ground truth):
private Cell generateDescription(HierarchicalTableGenerator gen,Row row,ElementDefinition definition,ElementDefinition fallback,boolean used,String baseURL,String url,StructureDefinition profile,String corePath,boolean root,boolean logicalModel) throws IOException {
  Cell c=gen.new Cell();
  row.getCells().add(c);
  if (used) {
    if (logicalModel && ToolingExtensions.hasExtension(profile,"String_Node_Str")) {
      if (root) {
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,ToolingExtensions.readStringExtension(profile,"String_Node_Str"),null));
      }
 else       if (!root && ToolingExtensions.hasExtension(definition,"String_Node_Str") && !ToolingExtensions.readStringExtension(definition,"String_Node_Str").equals(ToolingExtensions.readStringExtension(profile,"String_Node_Str"))) {
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,ToolingExtensions.readStringExtension(definition,"String_Node_Str"),null));
      }
    }
    if (definition.hasContentReference()) {
      ElementDefinition ed=getElementByName(profile.getSnapshot().getElement(),definition.getContentReference());
      if (ed == null)       c.getPieces().add(gen.new Piece(null,"String_Node_Str" + definition.getContentReference(),null));
 else       c.getPieces().add(gen.new Piece("String_Node_Str" + ed.getPath(),"String_Node_Str" + ed.getPath(),null));
    }
    if (definition.getPath().endsWith("String_Node_Str") && definition.hasFixed()) {
      c.getPieces().add(checkForNoChange(definition.getFixed(),gen.new Piece(null,"String_Node_Str" + buildJson(definition.getFixed()) + "String_Node_Str",null).addStyle("String_Node_Str")));
    }
 else {
      if (definition != null && definition.hasShort()) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        c.addPiece(checkForNoChange(definition.getShortElement(),gen.new Piece(null,definition.getShort(),null)));
      }
 else       if (fallback != null && fallback.hasShort()) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        c.addPiece(checkForNoChange(fallback.getShortElement(),gen.new Piece(null,fallback.getShort(),null)));
      }
      if (url != null) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        String fullUrl=url.startsWith("String_Node_Str") ? baseURL + url : url;
        StructureDefinition ed=context.fetchResource(StructureDefinition.class,url);
        String ref=ed == null ? null : (String)corePath + ed.getUserData("String_Node_Str");
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(ref,fullUrl,null));
      }
      if (definition.hasSlicing()) {
        if (!c.getPieces().isEmpty())         c.addPiece(gen.new Piece("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str"));
        c.getPieces().add(gen.new Piece(null,describeSlice(definition.getSlicing()),null));
      }
      if (definition != null) {
        if (definition.hasBinding()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          BindingResolution br=pkp.resolveBinding(definition.getBinding());
          c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) ? br.url : corePath + br.url,br.display,null)));
          if (definition.getBinding().hasStrength()) {
            c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(null,"String_Node_Str",null)));
            c.getPieces().add(checkForNoChange(definition.getBinding(),gen.new Piece(corePath + "String_Node_Str" + definition.getBinding().getStrength().toCode(),definition.getBinding().getStrength().toCode(),definition.getBinding().getStrength().getDefinition())));
            c.getPieces().add(gen.new Piece(null,"String_Node_Str",null));
          }
        }
        for (        ElementDefinitionConstraintComponent inv : definition.getConstraint()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(inv,gen.new Piece(null,inv.getKey() + "String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(inv,gen.new Piece(null,inv.getHuman(),null)));
        }
        if (definition.hasFixed()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(definition.getFixed(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getFixed(),gen.new Piece(null,buildJson(definition.getFixed()),null).addStyle("String_Node_Str")));
        }
 else         if (definition.hasPattern()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(definition.getPattern(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getPattern(),gen.new Piece(null,buildJson(definition.getPattern()),null).addStyle("String_Node_Str")));
        }
 else         if (definition.hasExample()) {
          if (!c.getPieces().isEmpty())           c.addPiece(gen.new Piece("String_Node_Str"));
          c.getPieces().add(checkForNoChange(definition.getExample(),gen.new Piece(null,"String_Node_Str",null).addStyle("String_Node_Str")));
          c.getPieces().add(checkForNoChange(definition.getExample(),gen.new Piece(null,buildJson(definition.getExample()),null).addStyle("String_Node_Str")));
        }
      }
    }
  }
  return c;
}