Program: 23411
Project: 23411
Buggy source:
private void parseTarget(StructureMapGroupRuleComponent rule,FHIRLexer lexer) throws FHIRException {
  StructureMapGroupRuleTargetComponent target=rule.addTarget();
  String start=lexer.take();
  if (lexer.hasToken("String_Node_Str")) {
    target.setContext(start);
    start=null;
    lexer.token("String_Node_Str");
    target.setElement(lexer.take());
  }
  String name;
  boolean isConstant=false;
  if (lexer.hasToken("String_Node_Str")) {
    if (start != null)     target.setContext(start);
    lexer.token("String_Node_Str");
    isConstant=lexer.isConstant(true);
    name=lexer.take();
  }
 else   name=start;
  if ("String_Node_Str".equals(name)) {
    target.setTransform(StructureMapTransform.EVALUATE);
    ExpressionNode node=fpe.parse(lexer);
    target.setUserData(MAP_EXPRESSION,node);
    target.addParameter().setValue(new StringType(node.toString()));
    lexer.token("String_Node_Str");
  }
 else   if (lexer.hasToken("String_Node_Str")) {
    target.setTransform(StructureMapTransform.fromCode(name));
    lexer.token("String_Node_Str");
    if (target.getTransform() == StructureMapTransform.EVALUATE) {
      parseParameter(target,lexer);
      lexer.token("String_Node_Str");
      ExpressionNode node=fpe.parse(lexer);
      target.setUserData(MAP_EXPRESSION,node);
      target.addParameter().setValue(new StringType(node.toString()));
    }
 else {
      while (!lexer.hasToken("String_Node_Str")) {
        parseParameter(target,lexer);
        if (!lexer.hasToken("String_Node_Str"))         lexer.token("String_Node_Str");
      }
    }
    lexer.token("String_Node_Str");
  }
 else   if (name != null) {
    target.setTransform(StructureMapTransform.COPY);
    if (!isConstant) {
      String id=name;
      while (lexer.hasToken("String_Node_Str")) {
        id=id + lexer.take() + lexer.take();
      }
      target.addParameter().setValue(new IdType(id));
    }
 else     target.addParameter().setValue(readConstant(name,lexer));
  }
  if (lexer.hasToken("String_Node_Str")) {
    lexer.take();
    target.setVariable(lexer.take());
  }
  while (Utilities.existsInList(lexer.getCurrent(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
    if (lexer.getCurrent().equals("String_Node_Str")) {
      target.addListMode(StructureMapListMode.SHARE);
      lexer.next();
      target.setListRuleId(lexer.take());
    }
 else     if (lexer.getCurrent().equals("String_Node_Str"))     target.addListMode(StructureMapListMode.FIRST);
 else     target.addListMode(StructureMapListMode.LAST);
    lexer.next();
  }
}

Fixed version (ground truth):
private void parseTarget(StructureMapGroupRuleComponent rule,FHIRLexer lexer) throws FHIRException {
  StructureMapGroupRuleTargetComponent target=rule.addTarget();
  String start=lexer.take();
  if (lexer.hasToken("String_Node_Str")) {
    target.setContext(start);
    target.setContextType(StructureMapContextType.VARIABLE);
    start=null;
    lexer.token("String_Node_Str");
    target.setElement(lexer.take());
  }
  String name;
  boolean isConstant=false;
  if (lexer.hasToken("String_Node_Str")) {
    if (start != null)     target.setContext(start);
    lexer.token("String_Node_Str");
    isConstant=lexer.isConstant(true);
    name=lexer.take();
  }
 else   name=start;
  if ("String_Node_Str".equals(name)) {
    target.setTransform(StructureMapTransform.EVALUATE);
    ExpressionNode node=fpe.parse(lexer);
    target.setUserData(MAP_EXPRESSION,node);
    target.addParameter().setValue(new StringType(node.toString()));
    lexer.token("String_Node_Str");
  }
 else   if (lexer.hasToken("String_Node_Str")) {
    target.setTransform(StructureMapTransform.fromCode(name));
    lexer.token("String_Node_Str");
    if (target.getTransform() == StructureMapTransform.EVALUATE) {
      parseParameter(target,lexer);
      lexer.token("String_Node_Str");
      ExpressionNode node=fpe.parse(lexer);
      target.setUserData(MAP_EXPRESSION,node);
      target.addParameter().setValue(new StringType(node.toString()));
    }
 else {
      while (!lexer.hasToken("String_Node_Str")) {
        parseParameter(target,lexer);
        if (!lexer.hasToken("String_Node_Str"))         lexer.token("String_Node_Str");
      }
    }
    lexer.token("String_Node_Str");
  }
 else   if (name != null) {
    target.setTransform(StructureMapTransform.COPY);
    if (!isConstant) {
      String id=name;
      while (lexer.hasToken("String_Node_Str")) {
        id=id + lexer.take() + lexer.take();
      }
      target.addParameter().setValue(new IdType(id));
    }
 else     target.addParameter().setValue(readConstant(name,lexer));
  }
  if (lexer.hasToken("String_Node_Str")) {
    lexer.take();
    target.setVariable(lexer.take());
  }
  while (Utilities.existsInList(lexer.getCurrent(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
    if (lexer.getCurrent().equals("String_Node_Str")) {
      target.addListMode(StructureMapListMode.SHARE);
      lexer.next();
      target.setListRuleId(lexer.take());
    }
 else     if (lexer.getCurrent().equals("String_Node_Str"))     target.addListMode(StructureMapListMode.FIRST);
 else     target.addListMode(StructureMapListMode.LAST);
    lexer.next();
  }
}