Program: 12587
Project: 12587
Buggy source:
@Override protected boolean checkDescendantsURIcompliance(){
  if (!isTopLevelURIformCompliant(this.getIdentity()))   return false;
  boolean allDescendantsCompliant=true;
  if (!this.getSequenceConstraints().isEmpty()) {
    for (    SequenceConstraint sequenceConstraint : this.getSequenceConstraints()) {
      allDescendantsCompliant=allDescendantsCompliant && isChildURIcompliant(this,sequenceConstraint);
      if (!allDescendantsCompliant) {
        return allDescendantsCompliant;
      }
    }
  }
  if (!this.getComponents().isEmpty()) {
    for (    Component component : this.getComponents()) {
      allDescendantsCompliant=allDescendantsCompliant && isChildURIcompliant(this,component);
      if (!allDescendantsCompliant) {
        return allDescendantsCompliant;
      }
      if (!component.getMapsTos().isEmpty()) {
        for (        MapsTo mapsTo : component.getMapsTos()) {
          allDescendantsCompliant=allDescendantsCompliant && isChildURIcompliant(component,mapsTo);
          if (!allDescendantsCompliant) {
            return allDescendantsCompliant;
          }
        }
      }
    }
  }
  if (!this.getSequenceAnnotations().isEmpty()) {
    for (    SequenceAnnotation sequenceAnnotation : this.getSequenceAnnotations()) {
      allDescendantsCompliant=allDescendantsCompliant && isChildURIcompliant(this,sequenceAnnotation);
      if (!allDescendantsCompliant) {
        return allDescendantsCompliant;
      }
      Set<Location> locations=sequenceAnnotation.getLocations();
      for (      Location location : locations) {
        if (location instanceof Range) {
          allDescendantsCompliant=allDescendantsCompliant && isChildURIcompliant(sequenceAnnotation,location);
          if (!allDescendantsCompliant) {
            return allDescendantsCompliant;
          }
        }
        if (location instanceof Cut) {
          allDescendantsCompliant=allDescendantsCompliant && isChildURIcompliant(sequenceAnnotation,location);
          if (!allDescendantsCompliant) {
            return allDescendantsCompliant;
          }
        }
        if (location instanceof GenericLocation) {
          allDescendantsCompliant=allDescendantsCompliant && isChildURIcompliant(sequenceAnnotation,location);
          if (!allDescendantsCompliant) {
            return allDescendantsCompliant;
          }
        }
      }
    }
  }
  return allDescendantsCompliant;
}

Fixed version (ground truth):
@Override protected void checkDescendantsURIcompliance() throws SBOLValidationException {
  isTopLevelURIformCompliant(this.getIdentity());
  if (!this.getSequenceConstraints().isEmpty()) {
    for (    SequenceConstraint sequenceConstraint : this.getSequenceConstraints()) {
      try {
        isChildURIcompliant(this,sequenceConstraint);
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException(e.getRule(),sequenceConstraint);
      }
    }
  }
  if (!this.getComponents().isEmpty()) {
    for (    Component component : this.getComponents()) {
      try {
        isChildURIcompliant(this,component);
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException(e.getRule(),component);
      }
      if (!component.getMapsTos().isEmpty()) {
        for (        MapsTo mapsTo : component.getMapsTos()) {
          try {
            isChildURIcompliant(component,mapsTo);
          }
 catch (          SBOLValidationException e) {
            throw new SBOLValidationException(e.getRule(),mapsTo);
          }
        }
      }
    }
  }
  if (!this.getSequenceAnnotations().isEmpty()) {
    for (    SequenceAnnotation sequenceAnnotation : this.getSequenceAnnotations()) {
      try {
        isChildURIcompliant(this,sequenceAnnotation);
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException(e.getRule(),sequenceAnnotation);
      }
      Set<Location> locations=sequenceAnnotation.getLocations();
      for (      Location location : locations) {
        if (location instanceof Range) {
          try {
            isChildURIcompliant(sequenceAnnotation,location);
          }
 catch (          SBOLValidationException e) {
            throw new SBOLValidationException(e.getRule(),location);
          }
        }
        if (location instanceof Cut) {
          try {
            isChildURIcompliant(sequenceAnnotation,location);
          }
 catch (          SBOLValidationException e) {
            throw new SBOLValidationException(e.getRule(),location);
          }
        }
        if (location instanceof GenericLocation) {
          try {
            isChildURIcompliant(sequenceAnnotation,location);
          }
 catch (          SBOLValidationException e) {
            throw new SBOLValidationException(e.getRule(),location);
          }
        }
      }
    }
  }
}