if (bioEntity instanceof ArtificialDeletion) { ArtificialDeletion deletion = (ArtificialDeletion) bioEntity; if (deletion.getAvailable() != null) {
if (bioEntityClassName.equals("org.flymine.model.genomic.ArtificialDeletion")) { Boolean fieldValue; try { fieldValue = (Boolean) TypeUtil.getFieldValue(bioEntity, "available"); } catch (IllegalAccessException e) { throw new RuntimeException("can't access 'available' field in: " + bioEntity); } if (fieldValue != null) {
    private void writeFeature(PrintWriter gffWriter, Chromosome chr,                              BioEntity bioEntity, Location chromosomeLocation, String identifier,                              String featureType, String idType, Map extraAttributes,                              List synonymValues, List evidenceList, Integer flyMineId) {        StringBuffer lineBuffer = new StringBuffer();        lineBuffer.append(chromosomeFileNamePrefix(chr)).append("\t");        String source = ".";        if (evidenceList != null) {            Iterator evidenceIter = evidenceList.iterator();            while (evidenceIter.hasNext()) {                Evidence evidence = (Evidence) evidenceIter.next();                if (evidence instanceof ComputationalResult) {                    Analysis analysis = ((ComputationalResult) evidence).getAnalysis();                    if (analysis instanceof ComputationalAnalysis) {                        source = ((ComputationalAnalysis) analysis).getAlgorithm();                    }                }            }        }        lineBuffer.append(source).append("\t");        lineBuffer.append(featureType).append("\t");        if (chromosomeLocation == null && bioEntity == chr) {            // special case for Chromosome location            lineBuffer.append(1).append("\t").append(chr.getLength()).append("\t");        } else {            lineBuffer.append(chromosomeLocation.getStart()).append("\t");            lineBuffer.append(chromosomeLocation.getEnd()).append("\t");        }        lineBuffer.append(0).append("\t");                if (chromosomeLocation == null) {            lineBuffer.append(".");        } else {            if (chromosomeLocation.getStrand().intValue() == 1) {                lineBuffer.append("+");            } else {                if (chromosomeLocation.getStrand().intValue() == -1) {                    lineBuffer.append("-");                } else {                    lineBuffer.append(".");                }            }        }        lineBuffer.append("\t");        if (chromosomeLocation == null) {            lineBuffer.append(".");        } else {            if (chromosomeLocation.getPhase() == null) {                lineBuffer.append(".");            } else {                lineBuffer.append(chromosomeLocation.getPhase());            }        }        lineBuffer.append("\t");        Map attributes = new LinkedHashMap();        List identifiers = new ArrayList();        identifiers.add(identifier);        attributes.put(idType, identifiers);        ArrayList flyMineIDs = new ArrayList();        flyMineIDs.add(makeIdString(flyMineId));        attributes.put("FlyMineInternalID", flyMineIDs.clone());        List allIds = (List) flyMineIDs.clone();        if (synonymValues != null) {            Iterator synonymIter = synonymValues.iterator();            while (synonymIter.hasNext()) {                String thisSynonymValue = (String) synonymIter.next();                if (!allIds.contains(thisSynonymValue)) {                    allIds.add(thisSynonymValue);                }            }        }        attributes.put("Alias", allIds);        if (extraAttributes != null) {            Iterator extraAttributesIter = extraAttributes.keySet().iterator();            while (extraAttributesIter.hasNext()) {                String key = (String) extraAttributesIter.next();                attributes.put(key, extraAttributes.get(key));            }        }        if (bioEntity instanceof PCRProduct) {            ArrayList promoterFlagList = new ArrayList();            promoterFlagList.add(((PCRProduct) bioEntity).getPromoter().toString());            attributes.put("promoter", promoterFlagList);        }        if (bioEntity instanceof ArtificialDeletion) {            ArtificialDeletion deletion = (ArtificialDeletion) bioEntity;            if (deletion.getAvailable() != null) {                ArrayList availableFlagList = new ArrayList();                availableFlagList.add(((ArtificialDeletion) bioEntity).getAvailable().toString());                attributes.put("available", availableFlagList);            }        }        lineBuffer.append(stringifyAttributes(attributes));        gffWriter.println(lineBuffer.toString());    }