Program: 4994
Project: 4994
Buggy source:
public static ArtifactVersionRange parse(String artifactVersionStr) throws InvalidArtifactRangeException {
  if (!isVersionRange(artifactVersionStr)) {
    ArtifactVersion version=new ArtifactVersion(artifactVersionStr);
    if (version.getVersion() == null) {
      throw new InvalidArtifactRangeException(String.format("String_Node_Str",version));
    }
    return new ArtifactVersionRange(version,true,version,true);
  }
  boolean isLowerInclusive=artifactVersionStr.charAt(0) == '[';
  int commaIndex=artifactVersionStr.indexOf(',',1);
  if (commaIndex < 0) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr));
  }
  String lowerStr=artifactVersionStr.substring(1,commaIndex).trim();
  ArtifactVersion lower=new ArtifactVersion(lowerStr);
  if (lower.getVersion() == null) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr,lowerStr));
  }
  int versionEndIndex=indexOf(artifactVersionStr,']',')',commaIndex + 1);
  if (versionEndIndex < 0) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr));
  }
  String upperStr=artifactVersionStr.substring(commaIndex + 1,versionEndIndex).trim();
  ArtifactVersion upper=new ArtifactVersion(upperStr);
  if (upper.getVersion() == null) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr,upperStr));
  }
  boolean isUpperInclusive=artifactVersionStr.charAt(versionEndIndex) == ']';
  int comp=lower.compareTo(upper);
  if (comp > 0) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr,lowerStr,upperStr));
  }
 else   if (comp == 0 && isLowerInclusive && !isUpperInclusive) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str" + "String_Node_Str",artifactVersionStr,lowerStr));
  }
  return new ArtifactVersionRange(lower,isLowerInclusive,upper,isUpperInclusive);
}

Fixed version (ground truth):
public static ArtifactVersionRange parse(String artifactVersionStr) throws InvalidArtifactRangeException {
  if (!isVersionRange(artifactVersionStr)) {
    ArtifactVersion version=new ArtifactVersion(artifactVersionStr);
    if (version.getVersion() == null) {
      throw new InvalidArtifactRangeException(String.format("String_Node_Str",version));
    }
    return new ArtifactVersionRange(version,true,version,true);
  }
  boolean isLowerInclusive=artifactVersionStr.charAt(0) == '[';
  int commaIndex=artifactVersionStr.indexOf(',',1);
  if (commaIndex < 0) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr));
  }
  String lowerStr=artifactVersionStr.substring(1,commaIndex).trim();
  ArtifactVersion lower=new ArtifactVersion(lowerStr);
  if (lower.getVersion() == null) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr,lowerStr));
  }
  int versionEndIndex=indexOf(artifactVersionStr,']',')',commaIndex + 1);
  if (versionEndIndex < 0) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr));
  }
  if (versionEndIndex != artifactVersionStr.length() - 1) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr));
  }
  String upperStr=artifactVersionStr.substring(commaIndex + 1,versionEndIndex).trim();
  ArtifactVersion upper=new ArtifactVersion(upperStr);
  if (upper.getVersion() == null) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr,upperStr));
  }
  boolean isUpperInclusive=artifactVersionStr.charAt(versionEndIndex) == ']';
  int comp=lower.compareTo(upper);
  if (comp > 0) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str",artifactVersionStr,lowerStr,upperStr));
  }
 else   if (comp == 0 && isLowerInclusive && !isUpperInclusive) {
    throw new InvalidArtifactRangeException(String.format("String_Node_Str" + "String_Node_Str",artifactVersionStr,lowerStr));
  }
  return new ArtifactVersionRange(lower,isLowerInclusive,upper,isUpperInclusive);
}