Program: 147406
Project: 147406
Buggy source:
private static int parseIdentifiers(char[] chars,int start,StringBuilder b,boolean allowLeading0,String partName){
  int state=STATE_PRE_RELEASE;
  int partStart=-1;
  int i=start;
  while (i <= chars.length) {
    final int c=i == chars.length ? -1 : chars[i];
switch (state) {
case STATE_PRE_RELEASE:
      if ((c == '.' || c == EOS) && partStart == -1) {
        throw unexpectedChar(new String(chars),c);
      }
 else       if (c == '.') {
        if (!allowLeading0 && chars[partStart] == '0' && i - partStart > 1) {
          throw illegalLeadingChar(new String(chars),c,partName);
        }
        partStart=-1;
        b.appendCodePoint(c);
        i++;
        continue;
      }
    if (partStart == -1) {
      partStart=i;
    }
  if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '-') {
    b.appendCodePoint(c);
    state=STATE_PRE_RELEASE_ID;
  }
 else   if (c >= '0' && c <= '9') {
    b.appendCodePoint(c);
  }
 else   if (c == '+') {
    if (!allowLeading0 && chars[partStart] == '0' && i - partStart > 1) {
      throw illegalLeadingChar(new String(chars),c,partName);
    }
    partStart=-1;
    return STATE_BUILD_MD;
  }
 else   if (c == EOS) {
    if (!allowLeading0 && chars[partStart] == '0' && i - partStart > 1) {
      throw illegalLeadingChar(new String(chars),partStart,partName);
    }
  }
 else {
    throw unexpectedChar(new String(chars),c);
  }
break;
case STATE_PRE_RELEASE_ID:
if (c == '.') {
b.appendCodePoint(c);
partStart=-1;
state=STATE_PRE_RELEASE;
}
 else if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '-') {
b.appendCodePoint(c);
}
 else if (c >= '0' && c <= '9') {
b.appendCodePoint(c);
}
 else if (c == '+') {
partStart=-1;
return STATE_BUILD_MD;
}
 else if (c != EOS) {
throw unexpectedChar(new String(chars),c);
}
break;
default :
throw new IllegalStateException("String_Node_Str" + start);
}
++i;
}
return EOS;
}

Fixed version (ground truth):
private static int parseIdentifiers(char[] chars,int start,StringBuilder b,boolean allowLeading0,String partName){
  int state=STATE_PRE_RELEASE;
  int partStart=-1;
  int i=start;
  while (i <= chars.length) {
    final int c=i == chars.length ? -1 : chars[i];
switch (state) {
case STATE_PRE_RELEASE:
      if ((c == '.' || c == EOS) && partStart == -1) {
        throw unexpectedChar(new String(chars),c);
      }
 else       if (c == '.') {
        if (!allowLeading0 && chars[partStart] == '0' && i - partStart > 1) {
          throw illegalLeadingChar(new String(chars),c,partName);
        }
        partStart=-1;
        b.appendCodePoint(c);
        i++;
        continue;
      }
    if (partStart == -1) {
      partStart=i;
    }
  if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '-') {
    b.appendCodePoint(c);
    state=STATE_PRE_RELEASE_ID;
  }
 else   if (c >= '0' && c <= '9') {
    b.appendCodePoint(c);
  }
 else   if (c == '+') {
    if (!allowLeading0 && chars[partStart] == '0' && i - partStart > 1) {
      throw illegalLeadingChar(new String(chars),c,partName);
    }
    return STATE_BUILD_MD;
  }
 else   if (c == EOS) {
    if (!allowLeading0 && chars[partStart] == '0' && i - partStart > 1) {
      throw illegalLeadingChar(new String(chars),partStart,partName);
    }
  }
 else {
    throw unexpectedChar(new String(chars),c);
  }
break;
case STATE_PRE_RELEASE_ID:
if (c == '.') {
b.appendCodePoint(c);
partStart=-1;
state=STATE_PRE_RELEASE;
}
 else if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '-') {
b.appendCodePoint(c);
}
 else if (c >= '0' && c <= '9') {
b.appendCodePoint(c);
}
 else if (c == '+') {
return STATE_BUILD_MD;
}
 else if (c != EOS) {
throw unexpectedChar(new String(chars),c);
}
break;
default :
throw new IllegalStateException("String_Node_Str" + start);
}
++i;
}
return EOS;
}