if (feature instanceof CDS) {    continue; }
    void writeGFF(ObjectStore os)        throws ObjectStoreException, IOException {        Results results =            PostProcessUtil.findLocationAndObjects(os, Chromosome.class, BioEntity.class, false);        results.setBatchSize(2000);        Iterator resIter = results.iterator();        PrintWriter gffWriter = null;        // a Map of object classes to counts        Map objectCounts = null;        // Map from Transcript to Location (on Chromosome)        Map seenTranscripts = new HashMap();        // Map from exon to Location (on Chromosome)        Map seenTranscriptParts = new HashMap();        // the last Chromosome seen        Integer currentChrId = null;        Chromosome currentChr = null;        Map synonymMap = null;        Map evidenceMap = null;        while (resIter.hasNext()) {            ResultsRow rr = (ResultsRow) resIter.next();            Integer resultChrId = (Integer) rr.get(0);            BioEntity feature = (BioEntity) rr.get(1);            Location loc = (Location) rr.get(2);            // TODO XXX FIXME - see #628            if (feature instanceof ChromosomeBand) {                continue;            }            if (feature instanceof ArtificialDeletion) {                ArtificialDeletion ad = (ArtificialDeletion) feature;                if (!ad.getAvailable().booleanValue()) {                    // write only the available deletions because there are too many                    // ArtificialDeletions for GBrowse to work well                    continue;                }            }            if (currentChrId == null || !currentChrId.equals(resultChrId)) {                if (currentChrId != null) {                    writeTranscriptsAndExons(gffWriter, currentChr, seenTranscripts,                                             seenTranscriptParts, synonymMap, evidenceMap);                    seenTranscripts = new HashMap();                    seenTranscriptParts = new HashMap();                }                synonymMap = makeSynonymMap(os, resultChrId);                evidenceMap = makeEvidenceMap(os, resultChrId);                currentChr = (Chromosome) os.getObjectById(resultChrId);                if (!currentChr.getIdentifier().endsWith("_random")                    && !currentChr.getIdentifier().equals("M")                    && !currentChr.getOrganism().getAbbreviation().equals("MM")                    && !currentChr.getOrganism().getAbbreviation().equals("MD")                    && !currentChr.getOrganism().getAbbreviation().equals("RN")) {                    writeChromosomeFasta(currentChr);                    File gffFile = chromosomeGFFFile(currentChr);                    if (gffWriter != null) {                        gffWriter.close();                    }                    gffWriter = new PrintWriter(new FileWriter(gffFile));                    List synonymList = (List) synonymMap.get(currentChr.getId());                    List evidenceList = (List) evidenceMap.get(currentChr.getId());                    writeFeature(gffWriter, currentChr, currentChr, null,                                 chromosomeFileNamePrefix(currentChr),                                 "chromosome",                                 "Chromosome", null, synonymList, evidenceList, currentChr.getId());                    objectCounts = new HashMap();                    currentChrId = resultChrId;                }            }            // process Transcripts but not tRNAs            // we can't just check for MRNA because the Transcripts of Pseudogenes aren't MRNAs            if (feature instanceof Transcript && !(feature instanceof NcRNA)) {                seenTranscripts.put(feature, loc);            }            if (feature instanceof Exon                // || feature instanceof FivePrimeUTR || feature instanceof ThreePrimeUTR                ) {                seenTranscriptParts.put(feature, loc);            }            if (!currentChr.getIdentifier().endsWith("_random")                && !currentChr.getIdentifier().equals("M")                && !currentChr.getOrganism().getAbbreviation().equals("MM")                && !currentChr.getOrganism().getAbbreviation().equals("MD")                && !currentChr.getOrganism().getAbbreviation().equals("RN")) {                String identifier = feature.getIdentifier();                String featureType = getFeatureName(feature);                if (identifier == null) {                    identifier = featureType + "_" + objectCounts.get(feature.getClass());                }                List synonymList = (List) synonymMap.get(feature.getId());                List evidenceList = (List) evidenceMap.get(feature.getId());                Map extraAttributes = new HashMap();                                    if (feature instanceof ChromosomeBand) {                    ArrayList indexList = new ArrayList();                    indexList.add(objectCounts.get(feature.getClass()));                    extraAttributes.put("Index", indexList);                }                writeFeature(gffWriter, currentChr, feature, loc,                             identifier,                             featureType.toLowerCase(), featureType, extraAttributes,                             synonymList, evidenceList, feature.getId());            }            incrementCount(objectCounts, feature);        }        // special case for t1dmine/stemcellmine        if (!currentChr.getIdentifier().endsWith("_random")            && !currentChr.getIdentifier().equals("M")            && !currentChr.getOrganism().getAbbreviation().equals("MM")            && !currentChr.getOrganism().getAbbreviation().equals("MD")            && !currentChr.getOrganism().getAbbreviation().equals("RN")) {            writeTranscriptsAndExons(gffWriter, currentChr, seenTranscripts,                                     seenTranscriptParts, synonymMap, evidenceMap);        }        gffWriter.close();    }