if (bioEntity instanceof Transcript) {
if (bioEntity instanceof Transcript && !(bioEntity instanceof TRNA) && parent != null) {
    private void writeFeature(PrintWriter gffWriter, Chromosome chr,                              BioEntity bioEntity, Location location, Integer index,                              BioEntity parent)        throws IOException {        if (index == null) {            index = new Integer(0);        }        StringBuffer lineBuffer = new StringBuffer();        lineBuffer.append(chromosomeFileNamePrefix(chr)).append("\t");        lineBuffer.append(FLYMINE_STRING).append("\t");        String featureName = null;        if (bioEntity instanceof Transcript) {            featureName = "mRNA";        } else {            if (bioEntity instanceof Exon) {                featureName = "CDS";            } else {                Class bioEntityClass = bioEntity.getClass();                Set classes = DynamicUtil.decomposeClass(bioEntityClass);                StringBuffer nameBuffer = new StringBuffer();                Iterator iter = classes.iterator();                while (iter.hasNext()) {                    Class thisClass = (Class) iter.next();                    if (nameBuffer.length() > 0) {                        nameBuffer.append("_");                    } else {                        nameBuffer.append(TypeUtil.unqualifiedName(thisClass.getName()));                    }                }                featureName = nameBuffer.toString();            }        }         if (bioEntity instanceof Transcript || bioEntity instanceof Exon) {            lineBuffer.append(featureName).append("\t");        } else {            String lcName = featureName.toLowerCase();            lineBuffer.append(lcName).append("\t");        }        if (location == null && bioEntity == chr) {            // special case for Chromosome location            lineBuffer.append(1).append("\t").append(chr.getLength()).append("\t");        } else {            lineBuffer.append(location.getStart()).append("\t");            lineBuffer.append(location.getEnd()).append("\t");        }        lineBuffer.append(0).append("\t");        int strand;        if (location == null) {            lineBuffer.append(".");        } else {            if (location.getStrand().intValue() == 1) {                lineBuffer.append("+");            } else {                if (location.getStrand().intValue() == -1) {                    lineBuffer.append("-");                } else {                    lineBuffer.append(".");                }            }        }        lineBuffer.append("\t");        if (location == null) {            lineBuffer.append(".");        } else {            if (location.getPhase() == null) {                lineBuffer.append(".");            } else {                lineBuffer.append(location.getPhase());            }        }        lineBuffer.append("\t");        Map attributes = new LinkedHashMap();        List identifiers = new ArrayList();        if (location == null && bioEntity == chr) {            identifiers.add(chromosomeFileNamePrefix(chr));        } else {            if (bioEntity.getIdentifier() == null) {                identifiers.add(featureName + "_" + index);            } else {                if (bioEntity instanceof Exon) {                    identifiers.add(parent.getIdentifier());                } else {                    identifiers.add(bioEntity.getIdentifier());                }            }        }        if (bioEntity instanceof Transcript || bioEntity instanceof Exon) {            attributes.put("mRNA", identifiers);        } else {            attributes.put(featureName, identifiers);        }        ArrayList flyMineIDs = new ArrayList();        flyMineIDs.add("FlyMineInternalID_" + bioEntity.getId());        attributes.put("Alias", flyMineIDs);        attributes.put("FlyMineInternalID", (List) flyMineIDs.clone());        if (bioEntity instanceof Transcript) {            ArrayList geneNameList = new ArrayList();            geneNameList.add(parent.getIdentifier());            attributes.put("Gene", geneNameList);        }        if (bioEntity instanceof ChromosomeBand) {            ArrayList indexList = new ArrayList();            indexList.add(index.toString());            attributes.put("Index", indexList);        }                lineBuffer.append(SimpleGFFRecord.stringifyAttributes(attributes));        gffWriter.println(lineBuffer.toString());    }