Program: 147405
Project: 147405
Buggy source:
private Version(String v){
  int i=0;
  int stateBefore=STATE_MAJOR;
  int state=stateBefore;
  final char[] chars=v.toCharArray();
  int major=0;
  int minor=0;
  int patch=0;
  StringBuilder preRelease=null;
  StringBuilder buildMD=null;
  while (i <= chars.length) {
    final boolean stateSwitched=i == 0 || state != stateBefore;
    stateBefore=state;
    final int c=i == chars.length ? -1 : chars[i];
switch (state) {
case STATE_MAJOR:
      if (c != '.' && major == 0 && !stateSwitched) {
        throw illegalLeadingChar(v,c,"String_Node_Str");
      }
 else       if (c >= '0' && c <= '9') {
        major=Character.digit(c,10) + major * 10;
      }
 else       if (c == '.') {
        state=STATE_MINOR;
      }
 else {
        throw unexpectedChar(v,c);
      }
    break;
case STATE_MINOR:
  if (c != '.' && minor == 0 && !stateSwitched) {
    throw illegalLeadingChar(v,c,"String_Node_Str");
  }
 else   if (c >= '0' && c <= '9') {
    minor=Character.digit(c,10) + minor * 10;
  }
 else   if (c == '.') {
    state=STATE_PATCH;
  }
 else {
    throw unexpectedChar(v,c);
  }
break;
case STATE_PATCH:
if (c != EOS && c != '-' && c != '+' && patch == 0 && !stateSwitched) {
throw illegalLeadingChar(v,c,"String_Node_Str");
}
 else if (c >= '0' && c <= '9') {
patch=Character.digit(c,10) + patch * 10;
}
 else if (c == '-') {
state=STATE_PRE_RELEASE;
}
 else if (c == '+') {
state=STATE_BUILD_MD;
}
 else if (c != EOS) {
throw unexpectedChar(v,c);
}
break;
case STATE_PRE_RELEASE:
preRelease=new StringBuilder();
state=parseIdentifiers(chars,i,preRelease,false,"String_Node_Str");
i+=preRelease.length();
break;
case STATE_BUILD_MD:
buildMD=new StringBuilder();
state=parseIdentifiers(chars,i,buildMD,true,"String_Node_Str");
break;
case EOS:
break;
default :
throw new IllegalStateException("String_Node_Str" + state);
}
++i;
}
this.major=major;
this.minor=minor;
this.patch=patch;
checkParams(major,minor,patch);
this.preRelease=preRelease == null ? "String_Node_Str" : preRelease.toString();
this.buildMetaData=buildMD == null ? "String_Node_Str" : buildMD.toString();
}

Fixed version (ground truth):
private Version(String v){
  int i=0;
  int stateBefore=STATE_MAJOR;
  int state=stateBefore;
  final char[] chars=v.toCharArray();
  int majorPart=0;
  int minorPart=0;
  int patchpart=0;
  StringBuilder preReleasePart=null;
  StringBuilder buildMDPart=null;
  while (i <= chars.length) {
    final boolean stateSwitched=i == 0 || state != stateBefore;
    stateBefore=state;
    final int c=i == chars.length ? -1 : chars[i];
switch (state) {
case STATE_MAJOR:
      if (c != '.' && majorPart == 0 && !stateSwitched) {
        throw illegalLeadingChar(v,c,"String_Node_Str");
      }
 else       if (c >= '0' && c <= '9') {
        majorPart=Character.digit(c,10) + majorPart * 10;
      }
 else       if (c == '.') {
        state=STATE_MINOR;
      }
 else {
        throw unexpectedChar(v,c);
      }
    break;
case STATE_MINOR:
  if (c != '.' && minorPart == 0 && !stateSwitched) {
    throw illegalLeadingChar(v,c,"String_Node_Str");
  }
 else   if (c >= '0' && c <= '9') {
    minorPart=Character.digit(c,10) + minorPart * 10;
  }
 else   if (c == '.') {
    state=STATE_PATCH;
  }
 else {
    throw unexpectedChar(v,c);
  }
break;
case STATE_PATCH:
if (c != EOS && c != '-' && c != '+' && patchpart == 0 && !stateSwitched) {
throw illegalLeadingChar(v,c,"String_Node_Str");
}
 else if (c >= '0' && c <= '9') {
patchpart=Character.digit(c,10) + patchpart * 10;
}
 else if (c == '-') {
state=STATE_PRE_RELEASE;
}
 else if (c == '+') {
state=STATE_BUILD_MD;
}
 else if (c != EOS) {
throw unexpectedChar(v,c);
}
break;
case STATE_PRE_RELEASE:
preReleasePart=new StringBuilder();
state=parseIdentifiers(chars,i,preReleasePart,false,"String_Node_Str");
i+=preReleasePart.length();
break;
case STATE_BUILD_MD:
buildMDPart=new StringBuilder();
state=parseIdentifiers(chars,i,buildMDPart,true,"String_Node_Str");
break;
case EOS:
break;
default :
throw new IllegalStateException("String_Node_Str" + state);
}
++i;
}
this.major=majorPart;
this.minor=minorPart;
this.patch=patchpart;
checkParams(majorPart,minorPart,patchpart);
this.preRelease=preReleasePart == null ? "String_Node_Str" : preReleasePart.toString();
this.buildMetaData=buildMDPart == null ? "String_Node_Str" : buildMDPart.toString();
}