Program: 23434
Project: 23434
Buggy source:
private void checkInvariants(List<ValidationMessage> errors,String path,StructureDefinition profile,ElementDefinition ed,String typename,String typeProfile,Element resource,Element element) throws FHIRException, FHIRException {
  if (noInvariantChecks)   return;
  for (  ElementDefinitionConstraintComponent inv : ed.getConstraint()) {
    if (inv.hasExpression()) {
      ExpressionNode n=(ExpressionNode)inv.getUserData("String_Node_Str");
      if (n == null) {
        long t=System.nanoTime();
        n=fpe.parse(inv.getExpression());
        fpeTime=fpeTime + (System.nanoTime() - t);
        inv.setUserData("String_Node_Str",n);
      }
      String msg;
      boolean ok;
      try {
        long t=System.nanoTime();
        ok=fpe.evaluateToBoolean(resource,element,n);
        fpeTime=fpeTime + (System.nanoTime() - t);
        msg=fpe.forLog();
      }
 catch (      Exception ex) {
        ok=false;
        msg=ex.getMessage();
      }
      if (!ok) {
        ok=fpe.evaluateToBoolean(resource,element,n);
        if (!Utilities.noString(msg))         msg="String_Node_Str" + msg + "String_Node_Str";
        if (inv.getSeverity() == ConstraintSeverity.ERROR)         rule(errors,IssueType.INVARIANT,element.line(),element.col(),path,ok,inv.getHuman() + msg + "String_Node_Str"+ inv.getExpression()+ "String_Node_Str");
 else         if (inv.getSeverity() == ConstraintSeverity.WARNING)         warning(errors,IssueType.INVARIANT,element.line(),element.line(),path,ok,inv.getHuman() + msg + "String_Node_Str"+ inv.getExpression()+ "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
private void checkInvariants(List<ValidationMessage> errors,String path,StructureDefinition profile,ElementDefinition ed,String typename,String typeProfile,Element resource,Element element) throws FHIRException, FHIRException {
  if (noInvariantChecks)   return;
  for (  ElementDefinitionConstraintComponent inv : ed.getConstraint()) {
    if (inv.hasExpression()) {
      ExpressionNode n=(ExpressionNode)inv.getUserData("String_Node_Str");
      if (n == null) {
        long t=System.nanoTime();
        n=fpe.parse(inv.getExpression());
        fpeTime=fpeTime + (System.nanoTime() - t);
        inv.setUserData("String_Node_Str",n);
      }
      String msg;
      boolean ok;
      try {
        long t=System.nanoTime();
        ok=fpe.evaluateToBoolean(resource,element,n);
        fpeTime=fpeTime + (System.nanoTime() - t);
        msg=fpe.forLog();
      }
 catch (      Exception ex) {
        ok=false;
        msg=ex.getMessage();
      }
      if (!ok) {
        try {
          ok=fpe.evaluateToBoolean(resource,element,n);
        }
 catch (        PathEngineException e) {
          throw new FHIRException("String_Node_Str" + inv.getExpression() + "String_Node_Str"+ profile.getUrl()+ "String_Node_Str"+ path+ "String_Node_Str"+ e.getMessage());
        }
        if (!Utilities.noString(msg))         msg="String_Node_Str" + msg + "String_Node_Str";
        if (inv.getSeverity() == ConstraintSeverity.ERROR)         rule(errors,IssueType.INVARIANT,element.line(),element.col(),path,ok,inv.getHuman() + msg + "String_Node_Str"+ inv.getExpression()+ "String_Node_Str");
 else         if (inv.getSeverity() == ConstraintSeverity.WARNING)         warning(errors,IssueType.INVARIANT,element.line(),element.line(),path,ok,inv.getHuman() + msg + "String_Node_Str"+ inv.getExpression()+ "String_Node_Str");
      }
    }
  }
}