Program: 29493
Project: 29493
Buggy source:
@Override public TemplateBasicNodeBuilder setCmdText(String cmdText){
  Preconditions.checkState(this.cmdText == null);
  this.cmdText=cmdText;
  String commandTextForParsing=cmdText;
  String nameAttr;
  Matcher ntnMatcher=NONATTRIBUTE_TEMPLATE_NAME.matcher(commandTextForParsing);
  if (ntnMatcher.find()) {
    nameAttr=ntnMatcher.group();
    commandTextForParsing=commandTextForParsing.substring(ntnMatcher.end()).trim();
  }
 else {
    errorReporter.report(sourceLocation,MISSING_TEMPLATE_NAME);
    return this;
  }
  Map<String,String> attributes=ATTRIBUTES_PARSER.parse(commandTextForParsing,errorReporter,sourceLocation);
  if (attributes.get("String_Node_Str").equals("String_Node_Str")) {
    visibility=Visibility.LEGACY_PRIVATE;
  }
  String visibilityName=attributes.get("String_Node_Str");
  if (visibilityName != null) {
    if (visibility != null) {
      errorReporter.report(sourceLocation,PRIVATE_AND_VISIBILITY,visibilityName);
    }
    visibility=Visibility.forAttributeValue(visibilityName);
  }
  if (visibility == null) {
    visibility=Visibility.PUBLIC;
  }
  setAutoescapeCmdText(attributes);
  setRequireCssCmdText(attributes);
  setCssBaseCmdText(attributes);
  setV1Marker(attributes);
  if (BaseUtils.isIdentifierWithLeadingDot(nameAttr)) {
    if (soyFileHeaderInfo.namespace == null) {
      throw LegacyInternalSyntaxException.createWithMetaInfo("String_Node_Str",sourceLocation);
    }
    setTemplateNames(soyFileHeaderInfo.namespace + nameAttr,nameAttr);
  }
 else {
    if (!isMarkedV1 && BaseUtils.isDottedIdentifier(nameAttr)) {
      errorReporter.report(sourceLocation,FULLY_QUALIFIED_NAME);
    }
    setTemplateNames(nameAttr,null);
  }
  this.templateNameForUserMsgs=getTemplateName();
  return this;
}

Fixed version (ground truth):
@Override public TemplateBasicNodeBuilder setCmdText(String cmdText){
  Preconditions.checkState(this.cmdText == null);
  this.cmdText=cmdText;
  String commandTextForParsing=cmdText;
  String nameAttr;
  Matcher ntnMatcher=TEMPLATE_NAME.matcher(commandTextForParsing);
  if (ntnMatcher.find()) {
    nameAttr=ntnMatcher.group(1);
    commandTextForParsing=commandTextForParsing.substring(ntnMatcher.end()).trim();
  }
 else {
    errorReporter.report(sourceLocation,MISSING_TEMPLATE_NAME);
    return this;
  }
  Map<String,String> attributes=ATTRIBUTES_PARSER.parse(commandTextForParsing,errorReporter,sourceLocation);
  if (attributes.get("String_Node_Str").equals("String_Node_Str")) {
    visibility=Visibility.LEGACY_PRIVATE;
  }
  String visibilityName=attributes.get("String_Node_Str");
  if (visibilityName != null) {
    if (visibility != null) {
      errorReporter.report(sourceLocation,PRIVATE_AND_VISIBILITY,visibilityName);
    }
    visibility=Visibility.forAttributeValue(visibilityName);
  }
  if (visibility == null) {
    visibility=Visibility.PUBLIC;
  }
  setAutoescapeCmdText(attributes);
  setRequireCssCmdText(attributes);
  setCssBaseCmdText(attributes);
  setV1Marker(attributes);
  if (BaseUtils.isIdentifierWithLeadingDot(nameAttr)) {
    if (soyFileHeaderInfo.namespace == null) {
      throw LegacyInternalSyntaxException.createWithMetaInfo("String_Node_Str",sourceLocation);
    }
    setTemplateNames(soyFileHeaderInfo.namespace + nameAttr,nameAttr);
  }
 else {
    if (!isMarkedV1 && BaseUtils.isDottedIdentifier(nameAttr)) {
      errorReporter.report(sourceLocation,FULLY_QUALIFIED_NAME);
    }
    setTemplateNames(nameAttr,null);
  }
  this.templateNameForUserMsgs=getTemplateName();
  return this;
}