Program: 12479
Project: 12479
Buggy source:
private static void writeFeature(Writer w,SequenceAnnotation sa,String role,int offset,boolean inline) throws IOException, SBOLConversionException {
  if (sa.getPreciseLocations().size() == 0) {
    throw new SBOLConversionException("String_Node_Str" + sa.getIdentity() + "String_Node_Str");
  }
 else   if (sa.getPreciseLocations().size() == 1) {
    Location loc=sa.getPreciseLocations().iterator().next();
    boolean locReverse=false;
    if (loc.isSetOrientation()) {
      locReverse=loc.getOrientation().equals(OrientationType.REVERSECOMPLEMENT);
    }
    w.write("String_Node_Str" + role + "String_Node_Str"+ locationStr(loc,offset,((inline && locReverse) || (!inline && !locReverse)),null)+ "String_Node_Str");
  }
 else   if (stradlesOrigin(sa)) {
    Location loc=sa.getLocation("String_Node_Str");
    Location loc2=sa.getLocation("String_Node_Str");
    boolean locReverse=false;
    if (loc.isSetOrientation()) {
      locReverse=loc.getOrientation().equals(OrientationType.REVERSECOMPLEMENT);
    }
    w.write("String_Node_Str" + role + "String_Node_Str"+ locationStr(loc,offset,((inline && locReverse) || (!inline && !locReverse)),loc2)+ "String_Node_Str");
  }
 else {
    String multiType="String_Node_Str";
    Annotation annotation=sa.getAnnotation(new QName(GBNAMESPACE,MULTIRANGETYPE,GBPREFIX));
    if (annotation != null) {
      multiType=annotation.getStringValue();
    }
    String rangeStr="String_Node_Str" + role + "String_Node_Str"+ multiType+ "String_Node_Str";
    boolean first=true;
    for (    Location loc : sa.getSortedLocations()) {
      if (!first)       rangeStr+="String_Node_Str";
 else       first=false;
      boolean locReverse=false;
      if (loc.isSetOrientation()) {
        locReverse=loc.getOrientation().equals(OrientationType.REVERSECOMPLEMENT);
      }
      rangeStr+=locationStr(loc,offset,((inline && locReverse) || (!inline && !locReverse)),null);
    }
    rangeStr+="String_Node_Str";
    writeGenBankLine(w,rangeStr,80,21);
  }
  for (  Annotation a : sa.getAnnotations()) {
    if (a.getQName().getLocalPart().equals("String_Node_Str"))     continue;
    if (a.isStringValue()) {
      writeGenBankLine(w,"String_Node_Str" + a.getQName().getLocalPart() + "String_Node_Str"+ a.getStringValue(),80,21);
    }
  }
}

Fixed version (ground truth):
private static void writeFeature(Writer w,SequenceAnnotation sa,String role,int offset,boolean inline) throws IOException, SBOLConversionException {
  if (sa.getPreciseLocations().size() == 0) {
    throw new SBOLConversionException("String_Node_Str" + sa.getIdentity() + "String_Node_Str");
  }
 else   if (sa.getPreciseLocations().size() == 1) {
    Location loc=sa.getPreciseLocations().iterator().next();
    boolean locReverse=false;
    if (loc.isSetOrientation()) {
      locReverse=loc.getOrientation().equals(OrientationType.REVERSECOMPLEMENT);
    }
    w.write("String_Node_Str" + role + "String_Node_Str"+ locationStr(loc,offset,((inline && locReverse) || (!inline && !locReverse)),null)+ "String_Node_Str");
  }
 else   if (stradlesOrigin(sa)) {
    Location loc=sa.getLocation("String_Node_Str");
    Location loc2=sa.getLocation("String_Node_Str");
    boolean locReverse=false;
    if (loc.isSetOrientation()) {
      locReverse=loc.getOrientation().equals(OrientationType.REVERSECOMPLEMENT);
    }
    w.write("String_Node_Str" + role + "String_Node_Str"+ locationStr(loc,offset,((inline && locReverse) || (!inline && !locReverse)),loc2)+ "String_Node_Str");
  }
 else {
    String multiType="String_Node_Str";
    Annotation annotation=sa.getAnnotation(new QName(GBNAMESPACE,MULTIRANGETYPE,GBCONVPREFIX));
    if (annotation != null) {
      multiType=annotation.getStringValue();
    }
    String rangeStr="String_Node_Str" + role + "String_Node_Str"+ multiType+ "String_Node_Str";
    boolean first=true;
    for (    Location loc : sa.getSortedLocations()) {
      if (!first)       rangeStr+="String_Node_Str";
 else       first=false;
      boolean locReverse=false;
      if (loc.isSetOrientation()) {
        locReverse=loc.getOrientation().equals(OrientationType.REVERSECOMPLEMENT);
      }
      rangeStr+=locationStr(loc,offset,((inline && locReverse) || (!inline && !locReverse)),null);
    }
    rangeStr+="String_Node_Str";
    writeGenBankLine(w,rangeStr,80,21);
  }
  for (  Annotation a : sa.getAnnotations()) {
    if (a.getQName().getLocalPart().equals("String_Node_Str"))     continue;
    if (a.isStringValue()) {
      try {
        int aInt=Integer.parseInt(a.getStringValue());
        writeGenBankLine(w,"String_Node_Str" + a.getQName().getLocalPart() + "String_Node_Str"+ aInt,80,21);
      }
 catch (      NumberFormatException e) {
        writeGenBankLine(w,"String_Node_Str" + a.getQName().getLocalPart() + "String_Node_Str"+ "String_Node_Str"+ a.getStringValue()+ "String_Node_Str",80,21);
      }
    }
 else     if (a.isIntegerValue()) {
      writeGenBankLine(w,"String_Node_Str" + a.getQName().getLocalPart() + "String_Node_Str"+ a.getIntegerValue(),80,21);
    }
  }
}