    /**
     * Generate single "entry" xml {@link Element} from the given {@link Entry} and {@link Sequence}
     *
     * @param entry    Entry to serialize.
     * @param sequence Sequence to serialize.
     * @return xml Element.
     * @throws UtilityException
     */
    private static Element toEntryElement(Account account, Entry entry, Sequence sequence) throws UtilityException {
        if (entry == null) {
            return null;
        }

        DefaultElement entryRoot = new DefaultElement("entry", iceNamespace);

        entryRoot.add(new DefaultElement(RECORD_ID, iceNamespace).addText(entry.getRecordId()));
        entryRoot.add(new DefaultElement(RECORD_TYPE, iceNamespace).addText(entry.getRecordType()));
        entryRoot.add(new DefaultElement(CREATION_TIME_STAMP, iceNamespace)
                              .addText(simpleDateFormat.format(entry.getCreationTime())));
        if (entry.getModificationTime() != null) {
            entryRoot.add(new DefaultElement(MODIFICATION_TIME_STAMP, iceNamespace)
                                  .addText(simpleDateFormat.format(entry.getModificationTime())));
        } else {
            entryRoot.add(new DefaultElement(MODIFICATION_TIME_STAMP, iceNamespace)
                                  .addText(simpleDateFormat.format(entry.getCreationTime())));
        }
        DefaultElement partNumbers = new DefaultElement(PART_NUMBERS, iceNamespace);
        for (PartNumber partNumber : entry.getPartNumbers()) {
            partNumbers.add(new DefaultElement(PART_NUMBER, iceNamespace).addText(partNumber.getPartNumber()));
        }
        entryRoot.add(partNumbers);

        DefaultElement partNames = new DefaultElement(PART_NAMES, iceNamespace);
        for (Name name : entry.getNames()) {
            partNames.add(new DefaultElement(PART_NAME, iceNamespace).addText(name.getName()));
        }
        entryRoot.add(partNames);

        DefaultElement owner = new DefaultElement(OWNER, iceNamespace);
        owner.add(new DefaultElement(PERSON_NAME, iceNamespace).addText(emptyStringify(entry.getOwner())));
        owner.add(new DefaultElement(EMAIL, iceNamespace).addText(emptyStringify(entry.getOwnerEmail())));
        entryRoot.add(owner);

        DefaultElement creator = new DefaultElement(CREATOR, iceNamespace);
        creator.add(new DefaultElement(PERSON_NAME, iceNamespace).addText(emptyStringify(entry.getCreator())));
        creator.add(new DefaultElement(EMAIL, iceNamespace).addText(emptyStringify(entry.getCreatorEmail())));
        entryRoot.add(creator);

        if (entry.getLinks().size() > 0) {
            DefaultElement links = new DefaultElement(LINKS, iceNamespace);
            for (Link link : entry.getLinks()) {
                links.add(new DefaultElement(LINK, iceNamespace)
                                  .addAttribute(URL, emptyStringify(link.getUrl()))
                                  .addText(emptyStringify(link.getLink())));
            }
            entryRoot.add(links);
        }

        entryRoot.add(new DefaultElement(STATUS, iceNamespace).addText(emptyStringify(entry.getStatus())));

        entryRoot.add(new DefaultElement(LONG_DESCRIPTION, iceNamespace)
                              .addText(emptyStringify(entry.getLongDescription())));
        entryRoot.add(new DefaultElement(SHORT_DESCRIPTION, iceNamespace).addText(
                entry.getShortDescription()));
        entryRoot.add(new DefaultElement(REFERENCES, iceNamespace).addText(emptyStringify(entry.getReferences())));
        entryRoot.add(getEntryTypeSpecificFields(entry));

        entryRoot.add(new DefaultElement(BIO_SAFETY_LEVEL, iceNamespace)
                              .addText(emptyStringify(entry.getBioSafetyLevel().toString())));
        entryRoot.add(new DefaultElement(INTELLECTUAL_PROPERTY, iceNamespace)
                              .addText(emptyStringify(entry.getIntellectualProperty())));

        if (entry.getFundingSources().size() > 0) {
            DefaultElement fundingSources = new DefaultElement(FUNDING_SOURCES, iceNamespace);
            for (EntryFundingSource fundingSource : entry.getFundingSources()) {
                fundingSources.add(new DefaultElement(FUNDING_SOURCE, iceNamespace)
                                           .addText(emptyStringify(fundingSource.getFundingSource().getFundingSource()))
                                           .addAttribute(
                                                   PRINCIPAL_INVESTIGATOR,
                                                   emptyStringify(fundingSource.getFundingSource()
                                                                               .getPrincipalInvestigator())));
            }
            entryRoot.add(fundingSources);
        }

        if (sequence != null) {
            entryRoot.add(SeqXmlSerializer.serializeToSeqXmlAsElement(sequence));
        }

        ArrayList<Attachment> attachments;
        AttachmentController attachmentController = new AttachmentController();

        try {
            attachments = attachmentController.getByEntry(account, entry);
        } catch (ControllerException e) {
            throw new UtilityException(e);
        }
        if (attachments != null && attachments.size() > 0) {
            DefaultElement attachmentsRoot = new DefaultElement(ATTACHMENTS, iceNamespace);
            for (Attachment attachment : attachments) {
                File file;
                String fileString;
                try {
                    file = attachmentController.getFile(account, attachment);
                    fileString = SerializationUtils
                            .serializeBytesToBase64String(org.apache.commons.io.FileUtils.readFileToByteArray(file));
                } catch (IOException | ControllerException | PermissionException e) {
                    throw new UtilityException(e);
                }

                attachmentsRoot.add(new DefaultElement(ATTACHMENT, iceNamespace)
                                            .addCDATA(fileString).addAttribute(FILE_NAME, attachment.getFileName())
                                            .addAttribute(FILE_ID, attachment.getFileId())
                                            .addAttribute(DESCRIPTION, attachment.getDescription()));
            }
            entryRoot.add(attachmentsRoot);
        }

        Element expElement = getExperimentElement(entry);
        if (expElement != null) {
            entryRoot.add(expElement);
        }
        return entryRoot;
    }

    /**
     * Generate single "entry" xml {@link Element} from the given {@link Entry} and {@link Sequence}
     *
     * @param entry    Entry to serialize.
     * @param sequence Sequence to serialize.
     * @return xml Element.
     * @throws UtilityException
     */
    private static Element toEntryElement(Account account, Entry entry, Sequence sequence) throws UtilityException {
        if (entry == null) {
            return null;
        }

        DefaultElement entryRoot = new DefaultElement("entry", iceNamespace);

        entryRoot.add(new DefaultElement(RECORD_ID, iceNamespace).addText(entry.getRecordId()));
        entryRoot.add(new DefaultElement(RECORD_TYPE, iceNamespace).addText(entry.getRecordType()));
        entryRoot.add(new DefaultElement(CREATION_TIME_STAMP, iceNamespace)
                              .addText(simpleDateFormat.format(entry.getCreationTime())));
        if (entry.getModificationTime() != null) {
            entryRoot.add(new DefaultElement(MODIFICATION_TIME_STAMP, iceNamespace)
                                  .addText(simpleDateFormat.format(entry.getModificationTime())));
        } else {
            entryRoot.add(new DefaultElement(MODIFICATION_TIME_STAMP, iceNamespace)
                                  .addText(simpleDateFormat.format(entry.getCreationTime())));
        }
        DefaultElement partNumbers = new DefaultElement(PART_NUMBERS, iceNamespace);
        for (PartNumber partNumber : entry.getPartNumbers()) {
            partNumbers.add(new DefaultElement(PART_NUMBER, iceNamespace).addText(partNumber.getPartNumber()));
        }
        entryRoot.add(partNumbers);

        DefaultElement partNames = new DefaultElement(PART_NAMES, iceNamespace);
        for (Name name : entry.getNames()) {
            partNames.add(new DefaultElement(PART_NAME, iceNamespace).addText(name.getName()));
        }
        entryRoot.add(partNames);

        DefaultElement owner = new DefaultElement(OWNER, iceNamespace);
        owner.add(new DefaultElement(PERSON_NAME, iceNamespace).addText(emptyStringify(entry.getOwner())));
        owner.add(new DefaultElement(EMAIL, iceNamespace).addText(emptyStringify(entry.getOwnerEmail())));
        entryRoot.add(owner);

        DefaultElement creator = new DefaultElement(CREATOR, iceNamespace);
        creator.add(new DefaultElement(PERSON_NAME, iceNamespace).addText(emptyStringify(entry.getCreator())));
        creator.add(new DefaultElement(EMAIL, iceNamespace).addText(emptyStringify(entry.getCreatorEmail())));
        entryRoot.add(creator);

        if (entry.getLinks().size() > 0) {
            DefaultElement links = new DefaultElement(LINKS, iceNamespace);
            for (Link link : entry.getLinks()) {
                links.add(new DefaultElement(LINK, iceNamespace)
                                  .addAttribute(URL, emptyStringify(link.getUrl()))
                                  .addText(emptyStringify(link.getLink())));
            }
            entryRoot.add(links);
        }

        entryRoot.add(new DefaultElement(STATUS, iceNamespace).addText(emptyStringify(entry.getStatus())));

        entryRoot.add(new DefaultElement(LONG_DESCRIPTION, iceNamespace)
                              .addText(emptyStringify(entry.getLongDescription())));
        entryRoot.add(new DefaultElement(SHORT_DESCRIPTION, iceNamespace).addText(
                entry.getShortDescription()));
        entryRoot.add(new DefaultElement(REFERENCES, iceNamespace).addText(emptyStringify(entry.getReferences())));
        entryRoot.add(getEntryTypeSpecificFields(entry));

        entryRoot.add(new DefaultElement(BIO_SAFETY_LEVEL, iceNamespace)
                              .addText(emptyStringify(entry.getBioSafetyLevel().toString())));
        entryRoot.add(new DefaultElement(INTELLECTUAL_PROPERTY, iceNamespace)
                              .addText(emptyStringify(entry.getIntellectualProperty())));

        if (entry.getFundingSources().size() > 0) {
            DefaultElement fundingSources = new DefaultElement(FUNDING_SOURCES, iceNamespace);
            for (EntryFundingSource fundingSource : entry.getFundingSources()) {
                fundingSources.add(new DefaultElement(FUNDING_SOURCE, iceNamespace)
                                           .addText(emptyStringify(fundingSource.getFundingSource().getFundingSource()))
                                           .addAttribute(
                                                   PRINCIPAL_INVESTIGATOR,
                                                   emptyStringify(fundingSource.getFundingSource()
                                                                               .getPrincipalInvestigator())));
            }
            entryRoot.add(fundingSources);
        }

        if (sequence != null) {
            entryRoot.add(SeqXmlSerializer.serializeToSeqXmlAsElement(sequence));
        }

        ArrayList<Attachment> attachments;
        AttachmentController attachmentController = new AttachmentController();

        try {
            attachments = attachmentController.getByEntry(account, entry);
        } catch (ControllerException e) {
            throw new UtilityException(e);
        }
        if (attachments != null && attachments.size() > 0) {
            DefaultElement attachmentsRoot = new DefaultElement(ATTACHMENTS, iceNamespace);
            for (Attachment attachment : attachments) {
                File file;
                String fileString;
                try {
                    file = attachmentController.getFile(account, attachment);
                    fileString = SerializationUtils
                            .serializeBytesToBase64String(org.apache.commons.io.FileUtils.readFileToByteArray(file));
                } catch (FileNotFoundException e) {
                    throw new UtilityException(e);
                } catch (IOException e) {
                    throw new UtilityException(e);
                } catch (ControllerException e) {
                    throw new UtilityException(e);
                } catch (PermissionException e) {
                    throw new UtilityException(e);
                }

                attachmentsRoot.add(new DefaultElement(ATTACHMENT, iceNamespace)
                                            .addCDATA(fileString).addAttribute(FILE_NAME, attachment.getFileName())
                                            .addAttribute(FILE_ID, attachment.getFileId())
                                            .addAttribute(DESCRIPTION, attachment.getDescription()));
            }
            entryRoot.add(attachmentsRoot);
        }

        Element expElement = getExperimentElement(entry);
        if (expElement != null) {
            entryRoot.add(expElement);
        }
        return entryRoot;
    }

Merge Catch [catch(FileNotFoundException e), catch(IOException e), catch(ControllerException e), catch(PermissionException e)] to catch(IOException|ControllerException|PermissionException e) in method private toEntryElement(account Account, entry Entry, sequence Sequence) : Element from class org.jbei.ice.lib.utils.IceXmlSerializer


    /**
     * Checks if all samples have a common plate. If not, it determines which plate
     * is the most likely.
     *
     * @param sessionId id for session
     * @param samples   samples containing tube storage location with well parent
     * @return null if samples have a common plate, if not plate id (storage index) of most likely
     *         plate is returned
     * @throws SessionException
     * @throws ServiceException
     */
    @Override
    public String samplePlate(@WebParam(name = "sessionId") String sessionId,
            @WebParam(name = "samples") Sample[] samples) throws SessionException, ServiceException {
        log(sessionId, "samplePlate");
        StorageController storageController = ControllerFactory.getStorageController();
        HashMap<String, Integer> plateIndex = new HashMap<>();

        Sample initial = samples[0];
        Storage tube = initial.getStorage();

        // get tube by barcode and parent
        try {
            tube = storageController.retrieveStorageTube(tube.getIndex());
        } catch (ControllerException e) {
            Logger.error(e.getMessage());
            throw new ServiceException("Error retrieving storage location for tube " + tube.getIndex());
        }
        if (tube == null) {
            throw new ServiceException("Error retrieving storage location for tube");
        }

        Storage plate = tube.getParent().getParent();
        String highestFreqPlate = plate.getIndex();
        int highestFreqCount = 1;
        plateIndex.put(highestFreqPlate, highestFreqCount);

        for (int i = 1; i < samples.length; i += 1) {
            Sample sample = samples[i];
            String barcode = sample.getStorage().getIndex();
            if ("No Tube".equals(barcode) || "No Read".equals(barcode)) {
                continue;
            }

            try {
                tube = storageController.retrieveStorageTube(barcode);
            } catch (ControllerException e) {
                Logger.error(e.getMessage());
                throw new ServiceException("Error retrieving storage location for tube");
            }
            plate = tube.getParent().getParent();

            // check if this is new (not in plates map)
            Integer value = plateIndex.get(plate.getIndex());
            if (value == null) {
                // new
                plateIndex.put(plate.getIndex(), 1);
            } else {
                // update count
                value += 1;
                plateIndex.put(plate.getIndex(), value);
                if (value > highestFreqCount) {
                    highestFreqCount = value;
                    highestFreqPlate = plate.getIndex();
                }
            }
        }

        if (plateIndex.keySet().size() == 1) {
            return null;
        }

        return highestFreqPlate;
    }

    /**
     * Checks if all samples have a common plate. If not, it determines which plate
     * is the most likely.
     *
     * @param sessionId id for session
     * @param samples   samples containing tube storage location with well parent
     * @return null if samples have a common plate, if not plate id (storage index) of most likely
     *         plate is returned
     * @throws SessionException
     * @throws ServiceException
     */
    @Override
    public String samplePlate(@WebParam(name = "sessionId") String sessionId,
            @WebParam(name = "samples") Sample[] samples) throws SessionException, ServiceException {
        log(sessionId, "samplePlate");
        StorageController storageController = ControllerFactory.getStorageController();
        HashMap<String, Integer> plateIndex = new HashMap<String, Integer>();

        Sample initial = samples[0];
        Storage tube = initial.getStorage();

        // get tube by barcode and parent
        try {
            tube = storageController.retrieveStorageTube(tube.getIndex());
        } catch (ControllerException e) {
            Logger.error(e.getMessage());
            throw new ServiceException("Error retrieving storage location for tube " + tube.getIndex());
        }
        if (tube == null) {
            throw new ServiceException("Error retrieving storage location for tube");
        }

        Storage plate = tube.getParent().getParent();
        String highestFreqPlate = plate.getIndex();
        int highestFreqCount = 1;
        plateIndex.put(highestFreqPlate, highestFreqCount);

        for (int i = 1; i < samples.length; i += 1) {
            Sample sample = samples[i];
            String barcode = sample.getStorage().getIndex();
            if ("No Tube".equals(barcode) || "No Read".equals(barcode)) {
                continue;
            }

            try {
                tube = storageController.retrieveStorageTube(barcode);
            } catch (ControllerException e) {
                Logger.error(e.getMessage());
                throw new ServiceException("Error retrieving storage location for tube");
            }
            plate = tube.getParent().getParent();

            // check if this is new (not in plates map)
            Integer value = plateIndex.get(plate.getIndex());
            if (value == null) {
                // new
                plateIndex.put(plate.getIndex(), 1);
            } else {
                // update count
                value += 1;
                plateIndex.put(plate.getIndex(), value);
                if (value > highestFreqCount) {
                    highestFreqCount = value;
                    highestFreqPlate = plate.getIndex();
                }
            }
        }

        if (plateIndex.keySet().size() == 1) {
            return null;
        }

        return highestFreqPlate;
    }

Replace Generic With Diamond HashMap<String,Integer> with HashMap<> in method public samplePlate(sessionId String, samples Sample[]) : String from class org.jbei.ice.services.webservices.RegistryAPI


    /**
     * Check and automagically update sample storage for the given
     *
     * @param sessionId Session key.
     * @param samples   Samples
     * @param plateId   plateId
     * @return List of {@link Sample}s.
     * @throws SessionException
     * @throws ServiceException
     */
    @Override
    public List<Sample> checkAndUpdateSamplesStorage(
            @WebParam(name = "sessionId") String sessionId,
            @WebParam(name = "samples") Sample[] samples, @WebParam(name = "plateId") String plateId)
            throws SessionException, ServiceException {
        log(sessionId, "checkAndUpdateSamplesStorage: " + plateId);
        StorageController storageController = ControllerFactory.getStorageController();
        SampleController sampleController = ControllerFactory.getSampleController();

        // count of plates seen so far
        List<Sample> retSamples = new LinkedList<>();

        // for each sample (unique elements are the barcode (tube index))
        for (Sample sample : samples) {
            // sent storage location. note that barcode can be no read or no tube
            String barcode = sample.getStorage().getIndex();
            if ("No Tube".equals(barcode) || "No Read".equals(barcode)) {
                retSamples.add(sample);
                continue;
            }

            String location = sample.getStorage().getParent().getIndex();
            Storage recordedTube;

            try {
                // stored storage location
                recordedTube = storageController.retrieveStorageTube(barcode);
                Storage recordedWell = recordedTube.getParent();
                Storage recordedPlate = recordedWell.getParent();
                Storage parentScheme = recordedPlate.getParent();

                boolean samePlate = (plateId == null);
                boolean sameWell = recordedWell.getIndex().equals(location);

                if (samePlate) {
                    if (sameWell) {
                        ArrayList<Sample> ret = sampleController.getSamplesByStorage(recordedTube);
                        if (ret != null && !ret.isEmpty()) {
                            retSamples.add(ret.get(0));
                        }

                        continue; // no changes needed
                    } else {
                        // same plate but different well
                        Storage well = storageController.retrieveStorageBy("Well", location,
                                                                           StorageType.WELL, recordedPlate.getId());
                        if (well == null) {
                            throw new ServiceException(
                                    "Could not retrieve new location for storage");
                        }
                        recordedTube.setParent(well);
                        storageController.update(recordedTube);
                    }
                } else {
                    // different plate (update using the passed parameter)
                    Storage newPlate = storageController.retrieveStorageBy("Plate", plateId,
                                                                           StorageType.PLATE96, parentScheme.getId());
                    if (sameWell) {
                        // update plate only
                        recordedWell.setParent(newPlate);
                        storageController.update(recordedWell);

                    } else {
                        // update plate and well
                        Storage well = storageController.retrieveStorageBy("Well", location,
                                                                           StorageType.WELL, newPlate.getId());
                        recordedTube.setParent(well);
                        storageController.update(recordedTube);
                    }
                }
            } catch (ControllerException e) {
                Logger.error(e);
                throw new ServiceException("Error retrieving/updating some records!");
            }

            ArrayList<Sample> ret;
            try {
                ret = sampleController.getSamplesByStorage(recordedTube);
                if (ret != null && !ret.isEmpty()) {
                    retSamples.add(ret.get(0));
                }
            } catch (ControllerException e) {

                Logger.error(e);
                sample.setStorage(recordedTube);
                retSamples.add(sample);
            }

        }
        return retSamples;
    }

    /**
     * Check and automagically update sample storage for the given
     *
     * @param sessionId Session key.
     * @param samples   Samples
     * @param plateId   plateId
     * @return List of {@link Sample}s.
     * @throws SessionException
     * @throws ServiceException
     */
    @Override
    public List<Sample> checkAndUpdateSamplesStorage(
            @WebParam(name = "sessionId") String sessionId,
            @WebParam(name = "samples") Sample[] samples, @WebParam(name = "plateId") String plateId)
            throws SessionException, ServiceException {
        log(sessionId, "checkAndUpdateSamplesStorage: " + plateId);
        StorageController storageController = ControllerFactory.getStorageController();
        SampleController sampleController = ControllerFactory.getSampleController();

        // count of plates seen so far
        List<Sample> retSamples = new LinkedList<Sample>();

        // for each sample (unique elements are the barcode (tube index))
        for (Sample sample : samples) {
            // sent storage location. note that barcode can be no read or no tube
            String barcode = sample.getStorage().getIndex();
            if ("No Tube".equals(barcode) || "No Read".equals(barcode)) {
                retSamples.add(sample);
                continue;
            }

            String location = sample.getStorage().getParent().getIndex();
            Storage recordedTube;

            try {
                // stored storage location
                recordedTube = storageController.retrieveStorageTube(barcode);
                Storage recordedWell = recordedTube.getParent();
                Storage recordedPlate = recordedWell.getParent();
                Storage parentScheme = recordedPlate.getParent();

                boolean samePlate = (plateId == null);
                boolean sameWell = recordedWell.getIndex().equals(location);

                if (samePlate) {
                    if (sameWell) {
                        ArrayList<Sample> ret = sampleController.getSamplesByStorage(recordedTube);
                        if (ret != null && !ret.isEmpty()) {
                            retSamples.add(ret.get(0));
                        }

                        continue; // no changes needed
                    } else {
                        // same plate but different well
                        Storage well = storageController.retrieveStorageBy("Well", location,
                                                                           StorageType.WELL, recordedPlate.getId());
                        if (well == null) {
                            throw new ServiceException(
                                    "Could not retrieve new location for storage");
                        }
                        recordedTube.setParent(well);
                        storageController.update(recordedTube);
                    }
                } else {
                    // different plate (update using the passed parameter)
                    Storage newPlate = storageController.retrieveStorageBy("Plate", plateId,
                                                                           StorageType.PLATE96, parentScheme.getId());
                    if (sameWell) {
                        // update plate only
                        recordedWell.setParent(newPlate);
                        storageController.update(recordedWell);

                    } else {
                        // update plate and well
                        Storage well = storageController.retrieveStorageBy("Well", location,
                                                                           StorageType.WELL, newPlate.getId());
                        recordedTube.setParent(well);
                        storageController.update(recordedTube);
                    }
                }
            } catch (ControllerException e) {
                Logger.error(e);
                throw new ServiceException("Error retrieving/updating some records!");
            }

            ArrayList<Sample> ret;
            try {
                ret = sampleController.getSamplesByStorage(recordedTube);
                if (ret != null && !ret.isEmpty()) {
                    retSamples.add(ret.get(0));
                }
            } catch (ControllerException e) {

                Logger.error(e);
                sample.setStorage(recordedTube);
                retSamples.add(sample);
            }

        }
        return retSamples;
    }

Replace Generic With Diamond LinkedList<Sample> with LinkedList<> in method public checkAndUpdateSamplesStorage(sessionId String, samples Sample[], plateId String) : List<Sample> from class org.jbei.ice.services.webservices.RegistryAPI


    /**
     * Retrieve a list of {@link TraceSequence}s associated with the specified entry.
     *
     * @param sessionId Session key.
     * @param recordId  RecordId of the desired Entry.
     * @return List of TraceSequences.
     * @throws ServiceException
     * @throws SessionException
     */
    @Override
    public List<TraceSequence> listTraceSequenceFiles(
            @WebParam(name = "sessionId") String sessionId,
            @WebParam(name = "recordId") String recordId) throws ServiceException, SessionException {
        log(sessionId, "listTraceSequenceFiles: " + recordId);
        Account account = validateAccount(sessionId);
        List<TraceSequence> result = new ArrayList<>();
        SequenceAnalysisController sequenceAnalysisController = ControllerFactory.getSequenceAnalysisController();
        EntryController entryController = ControllerFactory.getEntryController();

        Entry entry;
        try {
            entry = entryController.getByRecordId(account, recordId);
            if (entry == null) {
                throw new ServiceException("Could not retrieve entry");
            }
        } catch (ControllerException e) {
            log(e.getMessage());
            throw new ServiceException("Could not retrieve entry: " + e.getMessage());
        } catch (PermissionException e) {
            log(e.getMessage());
            throw new ServiceException("No permission to view entry: " + recordId);
        }
        List<TraceSequence> traces;
        try {
            traces = sequenceAnalysisController.getTraceSequences(entry);
            if (traces == null) {
                return result;
            }
        } catch (ControllerException e) {
            throw new ServiceException("Could not retrieve traces: " + e.getMessage());
        }
        for (TraceSequence trace : traces) {
            //null out entry to reduce output.
            trace.setEntry(null);
            // null out traceSequenceAlignment.traceSequence, as it causes infinite nesting  in xml for some reason.
            if (trace.getTraceSequenceAlignment() != null)
                trace.getTraceSequenceAlignment().setTraceSequence(null);
            result.add(trace);
        }

        return result;
    }

    /**
     * Retrieve a list of {@link TraceSequence}s associated with the specified entry.
     *
     * @param sessionId Session key.
     * @param recordId  RecordId of the desired Entry.
     * @return List of TraceSequences.
     * @throws ServiceException
     * @throws SessionException
     */
    @Override
    public List<TraceSequence> listTraceSequenceFiles(
            @WebParam(name = "sessionId") String sessionId,
            @WebParam(name = "recordId") String recordId) throws ServiceException, SessionException {
        log(sessionId, "listTraceSequenceFiles: " + recordId);
        Account account = validateAccount(sessionId);
        List<TraceSequence> result = new ArrayList<TraceSequence>();
        SequenceAnalysisController sequenceAnalysisController = ControllerFactory.getSequenceAnalysisController();
        EntryController entryController = ControllerFactory.getEntryController();

        Entry entry;
        try {
            entry = entryController.getByRecordId(account, recordId);
            if (entry == null) {
                throw new ServiceException("Could not retrieve entry");
            }
        } catch (ControllerException e) {
            log(e.getMessage());
            throw new ServiceException("Could not retrieve entry: " + e.getMessage());
        } catch (PermissionException e) {
            log(e.getMessage());
            throw new ServiceException("No permission to view entry: " + recordId);
        }
        List<TraceSequence> traces;
        try {
            traces = sequenceAnalysisController.getTraceSequences(entry);
            if (traces == null) {
                return result;
            }
        } catch (ControllerException e) {
            throw new ServiceException("Could not retrieve traces: " + e.getMessage());
        }
        for (TraceSequence trace : traces) {
            //null out entry to reduce output.
            trace.setEntry(null);
            // null out traceSequenceAlignment.traceSequence, as it causes infinite nesting  in xml for some reason.
            if (trace.getTraceSequenceAlignment() != null)
                trace.getTraceSequenceAlignment().setTraceSequence(null);
            result.add(trace);
        }

        return result;
    }

Replace Generic With Diamond ArrayList<TraceSequence> with ArrayList<> in method public listTraceSequenceFiles(sessionId String, recordId String) : List<TraceSequence> from class org.jbei.ice.services.webservices.RegistryAPI


    public SearchResults executeSearchNoTerms(Account account, SearchQuery searchQuery,
                                              String projectName, String projectURL,
                                              HashMap<String, Float> userBoost) {
        ArrayList<EntryType> entryTypes = searchQuery.getEntryTypes();
        if (entryTypes == null) {
            entryTypes = new ArrayList<>();
            entryTypes.addAll(Arrays.asList(EntryType.values()));
        }

        Session session = HibernateHelper.getSessionFactory().getCurrentSession();
        int resultCount;
        FullTextSession fullTextSession = Search.getFullTextSession(session);
        BooleanQuery booleanQuery = new BooleanQuery();
        // get classes for search
        Class<?>[] classes = new Class<?>[EntryType.values().length];
        for (int i = 0; i < entryTypes.size(); i += 1) {
            classes[i] = SearchFieldFactory.entryClass(entryTypes.get(i));
        }

        booleanQuery = generateQueriesForType(fullTextSession, entryTypes, booleanQuery, null,
                searchQuery.getBioSafetyOption(), userBoost);

        // wrap Lucene query in a org.hibernate.Query
        org.hibernate.search.FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(booleanQuery, classes);

        // get max score
        fullTextQuery.setFirstResult(0); //start from the startth element
        fullTextQuery.setMaxResults(1);  //return count elements
        fullTextQuery.setProjection(FullTextQuery.SCORE);
        List result = fullTextQuery.list();
        float maxScore = -1f;
        if (result.size() == 1) {
            maxScore = ((Float) ((Object[]) (result.get(0)))[0]).floatValue();
        }
        // end get max score

        // get sorting values
        Sort sort = getSort(searchQuery.getParameters().isSortAscending(), searchQuery.getParameters().getSortField
                ());
        fullTextQuery.setSort(sort);

        // projection (specified properties must be stored in the index @Field(store=Store.YES))
        fullTextQuery.setProjection(FullTextQuery.SCORE, FullTextQuery.THIS);

        // enable security filter if needed
        checkEnableSecurityFilter(account, fullTextQuery);

        // enable has attachment/sequence/sample (if needed)
        fullTextQuery = checkEnableHasAttribute(session, fullTextQuery, searchQuery);

        // check if there is also a blast search
        HashMap<String, SearchResultInfo> blastInfo;
        try {
            blastInfo = checkEnableBlast(account, fullTextQuery, searchQuery);
        } catch (BlastException e) {
            Logger.error(e);
            return null;
        }

        // set paging params
        fullTextQuery.setFirstResult(searchQuery.getParameters().getStart());
        fullTextQuery.setMaxResults(searchQuery.getParameters().getRetrieveCount());

        resultCount = fullTextQuery.getResultSize();
        result = fullTextQuery.list();

        LinkedList<SearchResultInfo> searchResultInfos = new LinkedList<>();
        Iterator<Object[]> iterator = result.iterator();
        while (iterator.hasNext()) {
            Object[] objects = iterator.next();
            float score = ((Float) objects[0]).floatValue();
            Entry entry = (Entry) objects[1];
            SearchResultInfo searchResult;
            if (blastInfo != null) {
                searchResult = blastInfo.get(entry.getRecordId());
                if (searchResult == null) // this should not really happen since we already filter
                    continue;
            } else {
                searchResult = new SearchResultInfo();
                searchResult.setScore(score);
                EntryInfo info = ModelToInfoFactory.createTableViewData(entry, true);
                searchResult.setEntryInfo(info);
            }

            searchResult.setMaxScore(maxScore);
            searchResult.setWebPartnerName(projectName);
            searchResult.setWebPartnerURL(projectURL);
            searchResultInfos.add(searchResult);
        }

        SearchResults results = new SearchResults();
        results.setResultCount(resultCount);
        results.setResults(searchResultInfos);
        String email = "Anon";
        if (account != null)
            email = account.getEmail();
        Logger.info(email + ": obtained " + resultCount + " results for \"" + searchQuery.getQueryString() + "\"");
        return results;
    }

    public SearchResults executeSearchNoTerms(Account account, SearchQuery searchQuery,
                                              String projectName, String projectURL,
                                              HashMap<String, Float> userBoost) {
        ArrayList<EntryType> entryTypes = searchQuery.getEntryTypes();
        if (entryTypes == null) {
            entryTypes = new ArrayList<>();
            entryTypes.addAll(Arrays.asList(EntryType.values()));
        }

        Session session = HibernateHelper.getSessionFactory().getCurrentSession();
        int resultCount;
        FullTextSession fullTextSession = Search.getFullTextSession(session);
        BooleanQuery booleanQuery = new BooleanQuery();
        // get classes for search
        Class<?>[] classes = new Class<?>[EntryType.values().length];
        for (int i = 0; i < entryTypes.size(); i += 1) {
            classes[i] = SearchFieldFactory.entryClass(entryTypes.get(i));
        }

        booleanQuery = generateQueriesForType(fullTextSession, entryTypes, booleanQuery, null,
                searchQuery.getBioSafetyOption(), userBoost);

        // wrap Lucene query in a org.hibernate.Query
        org.hibernate.search.FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(booleanQuery, classes);

        // get max score
        fullTextQuery.setFirstResult(0); //start from the startth element
        fullTextQuery.setMaxResults(1);  //return count elements
        fullTextQuery.setProjection(FullTextQuery.SCORE);
        List result = fullTextQuery.list();
        float maxScore = -1f;
        if (result.size() == 1) {
            maxScore = ((Float) ((Object[]) (result.get(0)))[0]).floatValue();
        }
        // end get max score

        // get sorting values
        Sort sort = getSort(searchQuery.getParameters().isSortAscending(), searchQuery.getParameters().getSortField
                ());
        fullTextQuery.setSort(sort);

        // projection (specified properties must be stored in the index @Field(store=Store.YES))
        fullTextQuery.setProjection(FullTextQuery.SCORE, FullTextQuery.THIS);

        // enable security filter if needed
        checkEnableSecurityFilter(account, fullTextQuery);

        // enable has attachment/sequence/sample (if needed)
        fullTextQuery = checkEnableHasAttribute(session, fullTextQuery, searchQuery);

        // check if there is also a blast search
        HashMap<String, SearchResultInfo> blastInfo;
        try {
            blastInfo = checkEnableBlast(account, fullTextQuery, searchQuery);
        } catch (BlastException e) {
            Logger.error(e);
            return null;
        }

        // set paging params
        fullTextQuery.setFirstResult(searchQuery.getParameters().getStart());
        fullTextQuery.setMaxResults(searchQuery.getParameters().getRetrieveCount());

        resultCount = fullTextQuery.getResultSize();
        result = fullTextQuery.list();

        LinkedList<SearchResultInfo> searchResultInfos = new LinkedList<SearchResultInfo>();
        Iterator<Object[]> iterator = result.iterator();
        while (iterator.hasNext()) {
            Object[] objects = iterator.next();
            float score = ((Float) objects[0]).floatValue();
            Entry entry = (Entry) objects[1];
            SearchResultInfo searchResult;
            if (blastInfo != null) {
                searchResult = blastInfo.get(entry.getRecordId());
                if (searchResult == null) // this should not really happen since we already filter
                    continue;
            } else {
                searchResult = new SearchResultInfo();
                searchResult.setScore(score);
                EntryInfo info = ModelToInfoFactory.createTableViewData(entry, true);
                searchResult.setEntryInfo(info);
            }

            searchResult.setMaxScore(maxScore);
            searchResult.setWebPartnerName(projectName);
            searchResult.setWebPartnerURL(projectURL);
            searchResultInfos.add(searchResult);
        }

        SearchResults results = new SearchResults();
        results.setResultCount(resultCount);
        results.setResults(searchResultInfos);
        String email = "Anon";
        if (account != null)
            email = account.getEmail();
        Logger.info(email + ": obtained " + resultCount + " results for \"" + searchQuery.getQueryString() + "\"");
        return results;
    }

Replace Generic With Diamond LinkedList<SearchResultInfo> with LinkedList<> in method public executeSearchNoTerms(account Account, searchQuery SearchQuery, projectName String, projectURL String, userBoost HashMap<String,Float>) : SearchResults from class org.jbei.ice.lib.search.HibernateSearch


    public SearchResults executeSearch(Account account, Iterator<String> terms, SearchQuery searchQuery,
                                       String projectName, String projectURL, HashMap<String, Float> userBoost) {
        // types for which we are searching
        ArrayList<EntryType> entryTypes = searchQuery.getEntryTypes();
        if (entryTypes == null) {
            entryTypes = new ArrayList<>();
            entryTypes.addAll(Arrays.asList(EntryType.values()));
        }

        Session session = HibernateHelper.getSessionFactory().getCurrentSession();
        int resultCount;
        FullTextSession fullTextSession = Search.getFullTextSession(session);
        BooleanQuery booleanQuery = new BooleanQuery();

        // get classes for search
        Class<?>[] classes = new Class<?>[EntryType.values().length];
        for (int i = 0; i < entryTypes.size(); i += 1) {
            classes[i] = SearchFieldFactory.entryClass(entryTypes.get(i));
        }

        // generate queries for terms
        while (terms.hasNext()) {
            String term = terms.next();
            if (StandardAnalyzer.STOP_WORDS_SET.contains(term))
                continue;

            BioSafetyOption safetyOption = searchQuery.getBioSafetyOption();
            booleanQuery = generateQueriesForType(fullTextSession, entryTypes, booleanQuery, term,
                    safetyOption, userBoost);
        }

        if (booleanQuery.getClauses().length == 0)
            return executeSearchNoTerms(account, searchQuery, projectName, projectURL, userBoost);

        // wrap Lucene query in a org.hibernate.Query
        org.hibernate.search.FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(booleanQuery, classes);

        // get max score
        fullTextQuery.setFirstResult(0); //start from the "start"th element
        fullTextQuery.setMaxResults(1);  //return count elements
        fullTextQuery.setProjection(FullTextQuery.SCORE);
        List result = fullTextQuery.list();
        float maxScore = -1f;
        if (result.size() == 1) {
            maxScore = ((Float) ((Object[]) (result.get(0)))[0]).floatValue();
        }
        // end get max score

        // get sorting values
        Sort sort = getSort(searchQuery.getParameters().isSortAscending(), searchQuery.getParameters().getSortField());
        fullTextQuery.setSort(sort);

        // projection (specified properties must be stored in the index @Field(store=Store.YES))
        fullTextQuery.setProjection(FullTextQuery.SCORE, FullTextQuery.THIS);

        // enable security filter if needed
        checkEnableSecurityFilter(account, fullTextQuery);

        // enable has attachment/sequence/sample (if needed)
        fullTextQuery = checkEnableHasAttribute(session, fullTextQuery, searchQuery);

        // check if there is also a blast search
        HashMap<String, SearchResultInfo> blastInfo;
        try {
            blastInfo = checkEnableBlast(account, fullTextQuery, searchQuery);
        } catch (BlastException e) {
            Logger.error(e);
            return null;
        }

        // set paging params
        fullTextQuery.setFirstResult(searchQuery.getParameters().getStart());
        fullTextQuery.setMaxResults(searchQuery.getParameters().getRetrieveCount());

        resultCount = fullTextQuery.getResultSize();

        // execute search
        result = fullTextQuery.list();
        String email = "Anon";
        if (account != null)
            email = account.getEmail();
        Logger.info(email + ": obtained " + resultCount + " results for \"" + searchQuery.getQueryString() + "\"");

        LinkedList<SearchResultInfo> searchResultInfos = new LinkedList<>();
        Iterator<Object[]> iterator = result.iterator();
        while (iterator.hasNext()) {
            Object[] objects = iterator.next();
            float score = ((Float) objects[0]).floatValue();
            Entry entry = (Entry) objects[1];
            SearchResultInfo searchResult;
            if (blastInfo != null) {
                searchResult = blastInfo.get(entry.getRecordId());
                if (searchResult == null) // this should not really happen since we already filter
                    continue;
            } else {
                searchResult = new SearchResultInfo();
                searchResult.setScore(score);
                EntryInfo info = ModelToInfoFactory.createTableViewData(entry, true);
                if (info == null)
                    continue;
                searchResult.setEntryInfo(info);
            }

            searchResult.setMaxScore(maxScore);
            searchResult.setWebPartnerName(projectName);
            searchResult.setWebPartnerURL(projectURL);
            searchResultInfos.add(searchResult);
        }

        SearchResults results = new SearchResults();
        results.setResultCount(resultCount);
        results.setResults(searchResultInfos);
        return results;
    }

    public SearchResults executeSearch(Account account, Iterator<String> terms, SearchQuery searchQuery,
                                       String projectName, String projectURL, HashMap<String, Float> userBoost) {
        // types for which we are searching
        ArrayList<EntryType> entryTypes = searchQuery.getEntryTypes();
        if (entryTypes == null) {
            entryTypes = new ArrayList<>();
            entryTypes.addAll(Arrays.asList(EntryType.values()));
        }

        Session session = HibernateHelper.getSessionFactory().getCurrentSession();
        int resultCount;
        FullTextSession fullTextSession = Search.getFullTextSession(session);
        BooleanQuery booleanQuery = new BooleanQuery();

        // get classes for search
        Class<?>[] classes = new Class<?>[EntryType.values().length];
        for (int i = 0; i < entryTypes.size(); i += 1) {
            classes[i] = SearchFieldFactory.entryClass(entryTypes.get(i));
        }

        // generate queries for terms
        while (terms.hasNext()) {
            String term = terms.next();
            if (StandardAnalyzer.STOP_WORDS_SET.contains(term))
                continue;

            BioSafetyOption safetyOption = searchQuery.getBioSafetyOption();
            booleanQuery = generateQueriesForType(fullTextSession, entryTypes, booleanQuery, term,
                    safetyOption, userBoost);
        }

        if (booleanQuery.getClauses().length == 0)
            return executeSearchNoTerms(account, searchQuery, projectName, projectURL, userBoost);

        // wrap Lucene query in a org.hibernate.Query
        org.hibernate.search.FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(booleanQuery, classes);

        // get max score
        fullTextQuery.setFirstResult(0); //start from the "start"th element
        fullTextQuery.setMaxResults(1);  //return count elements
        fullTextQuery.setProjection(FullTextQuery.SCORE);
        List result = fullTextQuery.list();
        float maxScore = -1f;
        if (result.size() == 1) {
            maxScore = ((Float) ((Object[]) (result.get(0)))[0]).floatValue();
        }
        // end get max score

        // get sorting values
        Sort sort = getSort(searchQuery.getParameters().isSortAscending(), searchQuery.getParameters().getSortField());
        fullTextQuery.setSort(sort);

        // projection (specified properties must be stored in the index @Field(store=Store.YES))
        fullTextQuery.setProjection(FullTextQuery.SCORE, FullTextQuery.THIS);

        // enable security filter if needed
        checkEnableSecurityFilter(account, fullTextQuery);

        // enable has attachment/sequence/sample (if needed)
        fullTextQuery = checkEnableHasAttribute(session, fullTextQuery, searchQuery);

        // check if there is also a blast search
        HashMap<String, SearchResultInfo> blastInfo;
        try {
            blastInfo = checkEnableBlast(account, fullTextQuery, searchQuery);
        } catch (BlastException e) {
            Logger.error(e);
            return null;
        }

        // set paging params
        fullTextQuery.setFirstResult(searchQuery.getParameters().getStart());
        fullTextQuery.setMaxResults(searchQuery.getParameters().getRetrieveCount());

        resultCount = fullTextQuery.getResultSize();

        // execute search
        result = fullTextQuery.list();
        String email = "Anon";
        if (account != null)
            email = account.getEmail();
        Logger.info(email + ": obtained " + resultCount + " results for \"" + searchQuery.getQueryString() + "\"");

        LinkedList<SearchResultInfo> searchResultInfos = new LinkedList<SearchResultInfo>();
        Iterator<Object[]> iterator = result.iterator();
        while (iterator.hasNext()) {
            Object[] objects = iterator.next();
            float score = ((Float) objects[0]).floatValue();
            Entry entry = (Entry) objects[1];
            SearchResultInfo searchResult;
            if (blastInfo != null) {
                searchResult = blastInfo.get(entry.getRecordId());
                if (searchResult == null) // this should not really happen since we already filter
                    continue;
            } else {
                searchResult = new SearchResultInfo();
                searchResult.setScore(score);
                EntryInfo info = ModelToInfoFactory.createTableViewData(entry, true);
                if (info == null)
                    continue;
                searchResult.setEntryInfo(info);
            }

            searchResult.setMaxScore(maxScore);
            searchResult.setWebPartnerName(projectName);
            searchResult.setWebPartnerURL(projectURL);
            searchResultInfos.add(searchResult);
        }

        SearchResults results = new SearchResults();
        results.setResultCount(resultCount);
        results.setResults(searchResultInfos);
        return results;
    }

Replace Generic With Diamond LinkedList<SearchResultInfo> with LinkedList<> in method public executeSearch(account Account, terms Iterator<String>, searchQuery SearchQuery, projectName String, projectURL String, userBoost HashMap<String,Float>) : SearchResults from class org.jbei.ice.lib.search.HibernateSearch


    public static ArrayList<String> getDisplayList() {
        ArrayList<String> displayList = new ArrayList<>();
        for (StatusType type : StatusType.values()) {
            displayList.add(type.toString());
        }
        return displayList;
    }

    public static ArrayList<String> getDisplayList() {
        ArrayList<String> displayList = new ArrayList<String>();
        for (StatusType type : StatusType.values()) {
            displayList.add(type.toString());
        }
        return displayList;
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getDisplayList() : ArrayList<String> from class org.jbei.ice.shared.StatusType


    /**
     * Retrieve a list of {@link SequenceFeature}s with the given sequence string.
     *
     * @param sequenceString sequence to search for.
     * @return List of SequenceFeatures.
     */
    public List<SequenceFeature> getBySequence(String sequenceString) {
        ArrayList<SequenceFeature> result = new ArrayList<>();
        for (SequenceFeature sequenceFeature : sequenceFeatures) {
            String featureSequence = sequenceFeature.getFeature().getSequence();
            if (featureSequence.equals(sequenceString)) {
                result.add(sequenceFeature);
            }
        }
        return result;
    }

    /**
     * Retrieve a list of {@link SequenceFeature}s with the given sequence string.
     *
     * @param sequenceString sequence to search for.
     * @return List of SequenceFeatures.
     */
    public List<SequenceFeature> getBySequence(String sequenceString) {
        ArrayList<SequenceFeature> result = new ArrayList<SequenceFeature>();
        for (SequenceFeature sequenceFeature : sequenceFeatures) {
            String featureSequence = sequenceFeature.getFeature().getSequence();
            if (featureSequence.equals(sequenceString)) {
                result.add(sequenceFeature);
            }
        }
        return result;
    }

Replace Generic With Diamond ArrayList<SequenceFeature> with ArrayList<> in method public getBySequence(sequenceString String) : List<SequenceFeature> from class org.jbei.ice.lib.utils.SequenceFeatureCollection


    /**
     * Retrieve the {@link SequenceFeature}s that contain the given sequence position.
     *
     * @param genbankPosition 1 based position
     * @return List of SequeceFeatures.
     */
    public List<SequenceFeature> getFeaturesAt(int genbankPosition) {
        ArrayList<SequenceFeature> result = new ArrayList<>();
        for (SequenceFeature sequenceFeature : sequenceFeatures) {
            for (AnnotationLocation location : sequenceFeature.getAnnotationLocations()) {
                if (location.getGenbankStart() >= genbankPosition
                        && genbankPosition <= location.getEnd()) {
                    if (!result.contains(sequenceFeature)) {
                        result.add(sequenceFeature);
                    }
                }
            }

        }
        return result;
    }

    /**
     * Retrieve the {@link SequenceFeature}s that contain the given sequence position.
     *
     * @param genbankPosition 1 based position
     * @return List of SequeceFeatures.
     */
    public List<SequenceFeature> getFeaturesAt(int genbankPosition) {
        ArrayList<SequenceFeature> result = new ArrayList<SequenceFeature>();
        for (SequenceFeature sequenceFeature : sequenceFeatures) {
            for (AnnotationLocation location : sequenceFeature.getAnnotationLocations()) {
                if (location.getGenbankStart() >= genbankPosition
                        && genbankPosition <= location.getEnd()) {
                    if (!result.contains(sequenceFeature)) {
                        result.add(sequenceFeature);
                    }
                }
            }

        }
        return result;
    }

Replace Generic With Diamond ArrayList<SequenceFeature> with ArrayList<> in method public getFeaturesAt(genbankPosition int) : List<SequenceFeature> from class org.jbei.ice.lib.utils.SequenceFeatureCollection


    /**
     * Retrieve the {@link SequenceTraceFile} value object of the given TraceSequence.
     *
     * @param traceSequence
     * @return SequenceTraceFile object
     * @throws ControllerException
     */
    public SequenceTraceFile getSequenceTraceFile(TraceSequence traceSequence)
            throws ControllerException {
        if (traceSequence == null) {
            return null;
        }

        String base64Data = null;

        File file = getFile(traceSequence);

        byte[] bytes;

        try (FileInputStream fileStream = new FileInputStream(file)) {
            bytes = new byte[(int) (file.length())];
            fileStream.read(bytes);
        } catch (IOException e) {
            throw new ControllerException(e);
        }

        base64Data = SerializationUtils.serializeBytesToBase64String(bytes);
        SequenceTraceFile result = new SequenceTraceFile();

        result.setDepositorEmail(traceSequence.getDepositor());
        result.setFileId(traceSequence.getFileId());
        result.setFileName(traceSequence.getFilename());
        result.setTimeStamp(new Date());
        result.setBase64Data(base64Data);

        return result;
    }

    /**
     * Retrieve the {@link SequenceTraceFile} value object of the given TraceSequence.
     *
     * @param traceSequence
     * @return SequenceTraceFile object
     * @throws ControllerException
     */
    public SequenceTraceFile getSequenceTraceFile(TraceSequence traceSequence)
            throws ControllerException {
        if (traceSequence == null) {
            return null;
        }

        String base64Data = null;

        File file = getFile(traceSequence);

        byte[] bytes;

        try {
            FileInputStream fileStream = new FileInputStream(file);
            bytes = new byte[(int) (file.length())];

            fileStream.read(bytes);

        } catch (FileNotFoundException e) {
            throw new ControllerException(e);
        } catch (IOException e) {
            throw new ControllerException(e);
        }

        base64Data = SerializationUtils.serializeBytesToBase64String(bytes);
        SequenceTraceFile result = new SequenceTraceFile();

        result.setDepositorEmail(traceSequence.getDepositor());
        result.setFileId(traceSequence.getFileId());
        result.setFileName(traceSequence.getFilename());
        result.setTimeStamp(new Date());
        result.setBase64Data(base64Data);

        return result;
    }

Try With Resources try(FileInputStream fileStream=new FileInputStream(file)) in method public getSequenceTraceFile(traceSequence TraceSequence) : SequenceTraceFile from class org.jbei.ice.lib.entry.sequence.SequenceAnalysisController


    public String uploadBulkUploadFile(Account account, File file, String bulkUploadIdStr, String entryId,
                                       String saveName, boolean isSequence, String entryType, String entryAddType) {
        long bulkUploadId;
        try {
            bulkUploadId = Long.decode(bulkUploadIdStr);
        } catch (NumberFormatException e) {
            Logger.error(e);
            bulkUploadId = 0;
        }

        EntryType type = EntryType.valueOf(entryType);
        EntryAddType addType = EntryAddType.valueOf(entryAddType);

        try {
            if (entryId == null || "0".equals(entryId.trim())) {
                return uploadToNewEntry(account, file, saveName, isSequence, type, addType, bulkUploadId);
            }

            // associate with entry
            EntryController entryController = ControllerFactory.getEntryController();
            AttachmentController attachmentController = ControllerFactory.getAttachmentController();

            Entry entry = null;

            try {
                boolean isStrainWithPlasmidPlasmid = (addType == EntryAddType.STRAIN_WITH_PLASMID
                        && type == EntryType.PLASMID);
                entry = entryController.get(account, Long.decode(entryId));
                if (isStrainWithPlasmidPlasmid) {
                    String plasmid = ((Strain) entry).getPlasmids();
                    entry = BulkUploadUtil.getPartNumberForStrainPlasmid(account,
                            ControllerFactory.getEntryController(),
                            plasmid);
                }
            } catch (NumberFormatException | ControllerException e) {
                Logger.error(e);
            }
            if (entry == null)
                return uploadToNewEntry(account, file, saveName, isSequence, type, addType, bulkUploadId);

            if (isSequence) {
                String sequenceString = FileUtils.readFileToString(file);
                ControllerFactory.getSequenceController().parseAndSaveSequence(account, entry, sequenceString);
                return saveName;
            } else {
                try (FileInputStream inputStream = new FileInputStream(file)) {
                    ArrayList<Attachment> attachments = attachmentController.getByEntry(account, entry);
                    if (attachments != null && !attachments.isEmpty()) {
                        for (Attachment attachment : attachments) {
                            try {
                                attachmentController.delete(account, attachment);
                            } catch (PermissionException e) {
                                continue;
                            }
                        }
                    }

                    Attachment attachment = new Attachment();
                    attachment.setEntry(entry);
                    attachment.setDescription("");
                    attachment.setFileName(saveName);
                    Attachment saved = attachmentController.save(account, attachment, inputStream);
                    if (saved != null)
                        return saved.getFileId();
                    return "";
                } catch (ControllerException e) {
                    Logger.error(e);
                }
                return "";
            }
        } catch (IOException | ControllerException e) {
            Logger.error(e);
            return "";
        }
    }

    public String uploadBulkUploadFile(Account account, File file, String bulkUploadIdStr, String entryId,
            String saveName, boolean isSequence, String entryType, String entryAddType) {
        long bulkUploadId;
        try {
            bulkUploadId = Long.decode(bulkUploadIdStr);
        } catch (NumberFormatException e) {
            Logger.error(e);
            bulkUploadId = 0;
        }

        EntryType type = EntryType.valueOf(entryType);
        EntryAddType addType = EntryAddType.valueOf(entryAddType);

        try {
            if (entryId == null || "0".equals(entryId.trim())) {
                return uploadToNewEntry(account, file, saveName, isSequence, type, addType, bulkUploadId);
            }

            // associate with entry
            EntryController entryController = ControllerFactory.getEntryController();
            AttachmentController attachmentController = ControllerFactory.getAttachmentController();

            Entry entry = null;

            try {
                boolean isStrainWithPlasmidPlasmid = (addType == EntryAddType.STRAIN_WITH_PLASMID
                        && type == EntryType.PLASMID);
                entry = entryController.get(account, Long.decode(entryId));
                if (isStrainWithPlasmidPlasmid) {
                    String plasmid = ((Strain) entry).getPlasmids();
                    entry = BulkUploadUtil.getPartNumberForStrainPlasmid(account,
                                                                         ControllerFactory.getEntryController(),
                                                                         plasmid);
                }
            } catch (NumberFormatException | ControllerException e) {
                Logger.error(e);
            }
            if (entry == null)
                return uploadToNewEntry(account, file, saveName, isSequence, type, addType, bulkUploadId);

            if (isSequence) {
                String sequenceString = FileUtils.readFileToString(file);
                ControllerFactory.getSequenceController().parseAndSaveSequence(account, entry, sequenceString);
                return saveName;
            } else {
                FileInputStream inputStream = new FileInputStream(file);
                try {
                    ArrayList<Attachment> attachments = attachmentController.getByEntry(account, entry);
                    if (attachments != null && !attachments.isEmpty()) {
                        for (Attachment attachment : attachments) {
                            try {
                                attachmentController.delete(account, attachment);
                            } catch (PermissionException e) {
                                continue;
                            }
                        }
                    }

                    Attachment attachment = new Attachment();
                    attachment.setEntry(entry);
                    attachment.setDescription("");
                    attachment.setFileName(saveName);
                    Attachment saved = attachmentController.save(account, attachment, inputStream);
                    if (saved != null)
                        return saved.getFileId();
                    return "";
                } catch (ControllerException e) {
                    Logger.error(e);
                }
                return "";
            }
        } catch (IOException | ControllerException e) {
            Logger.error(e);
            return "";
        }
    }

Try With Resources try(FileInputStream inputStream=new FileInputStream(file)) in method public uploadBulkUploadFile(account Account, file File, bulkUploadIdStr String, entryId String, saveName String, isSequence boolean, entryType String, entryAddType String) : String from class org.jbei.ice.server.servlet.FileUploadServlet


    private String uploadAttachment(Account account, File file, String entryId, String desc, String filename) {
        EntryController controller = ControllerFactory.getEntryController();
        Entry entry = null;
        try {
            entry = controller.get(account, Long.decode(entryId));
        } catch (NumberFormatException | ControllerException e) {
            Logger.error(e);
        }

        try (FileInputStream inputStream = new FileInputStream(file)) {
            if (entry != null) {
                try {
                    Attachment attachment = new Attachment();
                    attachment.setEntry(entry);
                    attachment.setDescription(desc);
                    attachment.setFileName(filename);
                    AttachmentController attachmentController = ControllerFactory.getAttachmentController();
                    Attachment saved = attachmentController.save(account, attachment, inputStream);
                    if (saved != null)
                        return saved.getFileId();
                } catch (ControllerException e) {
                    Logger.error(e);
                }
            } else {
                // upload file. return file id
                String fileId = Utils.generateUUID();
                File attDir = new File(Utils.getConfigValue(ConfigurationKey.ATTACHMENTS_DIRECTORY));
                FileUtils.writeFile(attDir, fileId, inputStream);
                return fileId;
            }
        } catch (IOException e) {
            Logger.error(e);
            return null;
        }

        return null;
    }

    private String uploadAttachment(Account account, File file, String entryId, String desc, String filename) {
        EntryController controller = ControllerFactory.getEntryController();
        Entry entry = null;
        try {
            entry = controller.get(account, Long.decode(entryId));
        } catch (NumberFormatException | ControllerException e) {
            Logger.error(e);
        }

        try {
            FileInputStream inputStream = new FileInputStream(file);
            if (entry != null) {
                try {
                    Attachment attachment = new Attachment();
                    attachment.setEntry(entry);
                    attachment.setDescription(desc);
                    attachment.setFileName(filename);
                    AttachmentController attachmentController = ControllerFactory.getAttachmentController();
                    Attachment saved = attachmentController.save(account, attachment, inputStream);
                    if (saved != null)
                        return saved.getFileId();
                } catch (ControllerException e) {
                    Logger.error(e);
                }
            } else {
                // upload file. return file id
                String fileId = Utils.generateUUID();
                File attDir = new File(Utils.getConfigValue(ConfigurationKey.ATTACHMENTS_DIRECTORY));
                FileUtils.writeFile(attDir, fileId, inputStream);
                return fileId;
            }
        } catch (IOException e) {
            Logger.error(e);
            return null;
        }

        return null;
    }

Try With Resources try(FileInputStream inputStream=new FileInputStream(file)) in method private uploadAttachment(account Account, file File, entryId String, desc String, filename String) : String from class org.jbei.ice.server.servlet.FileUploadServlet


    public String uploadToNewEntry(Account account, File file, String saveName, boolean isSequence, String entryType,
            String entryAddType, long bid) {
        EntryType type = EntryType.valueOf(entryType);
        EntryAddType addType = EntryAddType.valueOf(entryAddType);

        BulkUploadAutoUpdate update = new BulkUploadAutoUpdate();
        update.setBulkUploadId(bid);
        update.setType(type);
        try {
            update = ControllerFactory.getBulkUploadController().autoUpdateBulkUpload(account, update, addType);
            Entry entry = ControllerFactory.getEntryController().get(account, update.getEntryId());

            if (isSequence) {
                String sequenceString = FileUtils.readFileToString(file);
                ControllerFactory.getSequenceController().parseAndSaveSequence(account, entry, sequenceString);
                return Long.toString(update.getBulkUploadId()) + ","
                        + Long.toString(update.getEntryId()) + "," + saveName;
            }

            // if attachment
            AttachmentController attachmentController = ControllerFactory.getAttachmentController();
            FileInputStream inputStream = new FileInputStream(file);
            ArrayList<Attachment> attachments = attachmentController.getByEntry(account, entry);
            if (attachments != null && !attachments.isEmpty()) {
                for (Attachment attachment : attachments) {
                    try {
                        attachmentController.delete(account, attachment);
                    } catch (PermissionException e) {
                        continue;
                    }
                }
            }

            Attachment attachment = new Attachment();
            attachment.setEntry(entry);
            attachment.setDescription("");
            attachment.setFileName(saveName);
            Attachment saved = attachmentController.save(account, attachment, inputStream);
            if (saved != null) {
                return Long.toString(update.getBulkUploadId()) + "," + Long.toString(update.getEntryId())
                        + ", " + saved.getFileId();
            }
            return "Error: Could not upload attachment";
        } catch (ControllerException | PermissionException | IOException e) {
            Logger.error(e);
            return "Error " + e.getMessage();
        }
    }

    public String uploadToNewEntry(Account account, File file, String saveName, boolean isSequence, String entryType,
            String entryAddType) {
        EntryType type = EntryType.valueOf(entryType);
        EntryAddType addType = EntryAddType.valueOf(entryAddType);

        BulkUploadAutoUpdate update = new BulkUploadAutoUpdate();
        update.setType(type);
        try {
            update = ControllerFactory.getBulkUploadController().autoUpdateBulkUpload(account, update, addType);
            Entry entry = ControllerFactory.getEntryController().get(account, update.getEntryId());

            if (isSequence) {
                String sequenceString = FileUtils.readFileToString(file);
                ControllerFactory.getSequenceController().parseAndSaveSequence(account, entry, sequenceString);
                return Long.toString(update.getBulkUploadId()) + ","
                        + Long.toString(update.getEntryId()) + "," + saveName;
            }

            // if attachment
            AttachmentController attachmentController = ControllerFactory.getAttachmentController();
            FileInputStream inputStream = new FileInputStream(file);
            ArrayList<Attachment> attachments = attachmentController.getByEntry(account, entry);
            if (attachments != null && !attachments.isEmpty()) {
                for (Attachment attachment : attachments) {
                    try {
                        attachmentController.delete(account, attachment);
                    } catch (PermissionException e) {
                        continue;
                    }
                }
            }

            Attachment attachment = new Attachment();
            attachment.setEntry(entry);
            attachment.setDescription("");
            attachment.setFileName(saveName);
            Attachment saved = attachmentController.save(account, attachment, inputStream);
            if (saved != null) {
                return Long.toString(update.getBulkUploadId()) + "," + Long.toString(update.getEntryId())
                        + ", " + saved.getFileId();
            }
            return "Error: Could not upload attachment";
        } catch (ControllerException | PermissionException e) {
            Logger.error(e);
            return "Error " + e.getMessage();
        } catch (IOException e) {
            Logger.error(e);
            return "Error " + e.getMessage();
        }
    }

Merge Catch [catch(ControllerException|PermissionException e), catch(IOException e)] to catch(ControllerException|PermissionException|IOException e) in method public uploadToNewEntry(account Account, file File, saveName String, isSequence boolean, entryType String, entryAddType String, bid long) : String from class org.jbei.ice.server.servlet.FileUploadServlet


    private String uploadSequenceTraceFile(File file, String entryId, Account account, String uploadFileName)
            throws IOException {
        EntryController controller = ControllerFactory.getEntryController();
        Entry entry = null;
        try {
            entry = controller.get(account, Long.decode(entryId));
        } catch (NumberFormatException | ControllerException | PermissionException e) {
            Logger.error(e);
        }

        if (entry == null)
            return "Unknown entry (" + entryId + "). Upload aborted";

        SequenceAnalysisController sequenceAnalysisController = ControllerFactory.getSequenceAnalysisController();
        IDNASequence dnaSequence;

        ArrayList<ByteHolder> byteHolders = new ArrayList<>();
        FileInputStream inputStream = new FileInputStream(file);

        if (uploadFileName.toLowerCase().endsWith(".zip")) {
            try (ZipInputStream zis = new ZipInputStream(inputStream)) {
                ZipEntry zipEntry;
                while (true) {
                    zipEntry = zis.getNextEntry();

                    if (zipEntry != null) {
                        if (!zipEntry.isDirectory() && !zipEntry.getName().startsWith("__MACOSX")) {
                            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                            int c;
                            while ((c = zis.read()) != -1) {
                                byteArrayOutputStream.write(c);
                            }
                            ByteHolder byteHolder = new ByteHolder();
                            byteHolder.setBytes(byteArrayOutputStream.toByteArray());
                            byteHolder.setName(zipEntry.getName());
                            byteHolders.add(byteHolder);
                        }
                    } else {
                        break;
                    }
                }
            } catch (IOException e) {
                String errMsg = ("Could not parse zip file.");
                Logger.error(errMsg);
                return errMsg;
            }
        } else {
            ByteHolder byteHolder = new ByteHolder();
            byteHolder.setBytes(IOUtils.toByteArray(inputStream));
            byteHolder.setName(uploadFileName);
            byteHolders.add(byteHolder);
        }

        String currentFileName = "";
        try {
            for (ByteHolder byteHolder : byteHolders) {
                currentFileName = byteHolder.getName();
                dnaSequence = sequenceAnalysisController.parse(byteHolder.getBytes());
                if (dnaSequence == null || dnaSequence.getSequence() == null) {
                    String errMsg = ("Could not parse \"" + currentFileName
                            + "\". Only Fasta, GenBank & ABI files are supported.");
                    Logger.error(errMsg);
                    return errMsg;
                }

                sequenceAnalysisController.uploadTraceSequence(entry, byteHolder.getName(),
                                                               account.getEmail(),
                                                               dnaSequence.getSequence().toLowerCase(),
                                                               new ByteArrayInputStream(byteHolder.getBytes()));
            }
            sequenceAnalysisController.rebuildAllAlignments(entry);
            return "";
        } catch (ControllerException e) {
            String errMsg = ("Could not parse \"" + currentFileName
                    + "\". Only Fasta, GenBank & ABI files are supported.");
            Logger.error(errMsg);
            return errMsg;
        }
    }

    private String uploadSequenceTraceFile(File file, String entryId, Account account, String uploadFileName)
            throws IOException {
        EntryController controller = ControllerFactory.getEntryController();
        Entry entry = null;
        try {
            entry = controller.get(account, Long.decode(entryId));
        } catch (NumberFormatException | ControllerException | PermissionException e) {
            Logger.error(e);
        }

        if (entry == null)
            return "Unknown entry (" + entryId + "). Upload aborted";

        SequenceAnalysisController sequenceAnalysisController = ControllerFactory.getSequenceAnalysisController();
        IDNASequence dnaSequence;

        ArrayList<ByteHolder> byteHolders = new ArrayList<>();
        FileInputStream inputStream = new FileInputStream(file);

        if (uploadFileName.toLowerCase().endsWith(".zip")) {
            try {
                ZipInputStream zis = new ZipInputStream(inputStream);
                ZipEntry zipEntry;
                while (true) {
                    zipEntry = zis.getNextEntry();

                    if (zipEntry != null) {
                        if (!zipEntry.isDirectory() && !zipEntry.getName().startsWith("__MACOSX")) {
                            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                            int c;
                            while ((c = zis.read()) != -1) {
                                byteArrayOutputStream.write(c);
                            }
                            ByteHolder byteHolder = new ByteHolder();
                            byteHolder.setBytes(byteArrayOutputStream.toByteArray());
                            byteHolder.setName(zipEntry.getName());
                            byteHolders.add(byteHolder);
                        }
                    } else {
                        break;
                    }
                }
            } catch (IOException e) {
                String errMsg = ("Could not parse zip file.");
                Logger.error(errMsg);
                return errMsg;
            }
        } else {
            ByteHolder byteHolder = new ByteHolder();
            byteHolder.setBytes(IOUtils.toByteArray(inputStream));
            byteHolder.setName(uploadFileName);
            byteHolders.add(byteHolder);
        }

        String currentFileName = "";
        try {
            for (ByteHolder byteHolder : byteHolders) {
                currentFileName = byteHolder.getName();
                dnaSequence = sequenceAnalysisController.parse(byteHolder.getBytes());
                if (dnaSequence == null || dnaSequence.getSequence() == null) {
                    String errMsg = ("Could not parse \"" + currentFileName
                            + "\". Only Fasta, GenBank & ABI files are supported.");
                    Logger.error(errMsg);
                    return errMsg;
                }

                sequenceAnalysisController.uploadTraceSequence(entry, byteHolder.getName(),
                                                               account.getEmail(),
                                                               dnaSequence.getSequence().toLowerCase(),
                                                               new ByteArrayInputStream(byteHolder.getBytes()));
            }
            sequenceAnalysisController.rebuildAllAlignments(entry);
            return "";
        } catch (ControllerException e) {
            String errMsg = ("Could not parse \"" + currentFileName
                    + "\". Only Fasta, GenBank & ABI files are supported.");
            Logger.error(errMsg);
            return errMsg;
        }
    }

Try With Resources try(ZipInputStream zis=new ZipInputStream(inputStream)) in method private uploadSequenceTraceFile(file File, entryId String, account Account, uploadFileName String) : String from class org.jbei.ice.server.servlet.FileUploadServlet


    private static LinkedList<StorageInfo> getStorageListInfo(LinkedList<Storage> storageList) {
        LinkedList<StorageInfo> info = new LinkedList<>();

        if (storageList == null)
            return info;

        for (Storage storage : storageList) {
            info.add(getStorageInfo(storage));
        }

        return info;
    }

    private static LinkedList<StorageInfo> getStorageListInfo(LinkedList<Storage> storageList) {
        LinkedList<StorageInfo> info = new LinkedList<StorageInfo>();

        if (storageList == null)
            return info;

        for (Storage storage : storageList) {
            info.add(getStorageInfo(storage));
        }

        return info;
    }

Replace Generic With Diamond LinkedList<StorageInfo> with LinkedList<> in method private getStorageListInfo(storageList LinkedList<Storage>) : LinkedList<StorageInfo> from class org.jbei.ice.server.ModelToInfoFactory


    private static ArrayList<AttachmentInfo> getAttachments(List<Attachment> attachments) {
        ArrayList<AttachmentInfo> infos = new ArrayList<>();
        if (attachments == null)
            return infos;

        for (Attachment attachment : attachments) {
            AttachmentInfo info = new AttachmentInfo();
            info.setDescription(attachment.getDescription());
            info.setFilename(attachment.getFileName());
            info.setId(attachment.getId());
            info.setFileId(attachment.getFileId());
            infos.add(info);
        }

        return infos;
    }

    private static ArrayList<AttachmentInfo> getAttachments(List<Attachment> attachments) {
        ArrayList<AttachmentInfo> infos = new ArrayList<AttachmentInfo>();
        if (attachments == null)
            return infos;

        for (Attachment attachment : attachments) {
            AttachmentInfo info = new AttachmentInfo();
            info.setDescription(attachment.getDescription());
            info.setFilename(attachment.getFileName());
            info.setId(attachment.getId());
            info.setFileId(attachment.getFileId());
            infos.add(info);
        }

        return infos;
    }

Replace Generic With Diamond ArrayList<AttachmentInfo> with ArrayList<> in method private getAttachments(attachments List<Attachment>) : ArrayList<AttachmentInfo> from class org.jbei.ice.server.ModelToInfoFactory


    public static ArrayList<SequenceAnalysisInfo> getSequenceAnalysis(List<TraceSequence> sequences) {
        ArrayList<SequenceAnalysisInfo> infos = new ArrayList<>();
        if (sequences == null)
            return infos;

        AccountController accountController = ControllerFactory.getAccountController();
        for (TraceSequence sequence : sequences) {
            SequenceAnalysisInfo info = new SequenceAnalysisInfo();
            info.setCreated(sequence.getCreationTime());
            info.setName(sequence.getFilename());
            AccountInfo accountInfo = new AccountInfo();
            try {
                Account account = accountController.getByEmail(sequence.getDepositor());
                if (account != null) {
                    accountInfo.setFirstName(account.getFirstName());
                    accountInfo.setLastName(account.getLastName());
                    accountInfo.setId(account.getId());
                }
            } catch (ControllerException e) {
                Logger.warn(e.getMessage());
            }
            info.setDepositor(accountInfo);
            infos.add(info);
            info.setFileId(sequence.getFileId());
        }

        return infos;
    }

    public static ArrayList<SequenceAnalysisInfo> getSequenceAnalysis(List<TraceSequence> sequences) {
        ArrayList<SequenceAnalysisInfo> infos = new ArrayList<SequenceAnalysisInfo>();
        if (sequences == null)
            return infos;

        AccountController accountController = ControllerFactory.getAccountController();
        for (TraceSequence sequence : sequences) {
            SequenceAnalysisInfo info = new SequenceAnalysisInfo();
            info.setCreated(sequence.getCreationTime());
            info.setName(sequence.getFilename());
            AccountInfo accountInfo = new AccountInfo();
            try {
                Account account = accountController.getByEmail(sequence.getDepositor());
                if (account != null) {
                    accountInfo.setFirstName(account.getFirstName());
                    accountInfo.setLastName(account.getLastName());
                    accountInfo.setId(account.getId());
                }
            } catch (ControllerException e) {
                Logger.warn(e.getMessage());
            }
            info.setDepositor(accountInfo);
            infos.add(info);
            info.setFileId(sequence.getFileId());
        }

        return infos;
    }

Replace Generic With Diamond ArrayList<SequenceAnalysisInfo> with ArrayList<> in method public getSequenceAnalysis(sequences List<TraceSequence>) : ArrayList<SequenceAnalysisInfo> from class org.jbei.ice.server.ModelToInfoFactory


    private static EntryInfo getCommon(Account account, EntryInfo info, Entry entry) {
        info.setId(entry.getId());
        info.setRecordId(entry.getRecordId());
        info.setPartId(EntryUtil.getPartNumbersAsString(entry));
        info.setVersionId(entry.getVersionId());
        info.setName(entry.getNamesAsString());
        info.setOwner(entry.getOwner());
        info.setOwnerEmail(entry.getOwnerEmail());
        info.setCreator(entry.getCreator());
        info.setCreatorEmail(entry.getCreatorEmail());

        AccountController accountController = ControllerFactory.getAccountController();
        try {
            long ownerId = accountController.getAccountId(entry.getOwnerEmail());
            info.setOwnerId(ownerId);
            if (entry.getCreatorEmail() != null) {
                long creatorId = accountController.getAccountId(entry.getCreatorEmail());
                info.setCreatorId(creatorId);
            }
        } catch (ControllerException ce) {
        }

        info.setAlias(entry.getAlias());
        info.setKeywords(entry.getKeywords());
        info.setStatus(entry.getStatus());
        info.setShortDescription(entry.getShortDescription());
        info.setCreationTime(entry.getCreationTime());
        info.setModificationTime(entry.getModificationTime());
        info.setBioSafetyLevel(entry.getBioSafetyLevel());

        info.setLongDescription(entry.getLongDescription());
        info.setLongDescriptionType(entry.getLongDescriptionType());
        info.setIntellectualProperty(entry.getIntellectualProperty());
        info.setSelectionMarkers(entry.getSelectionMarkersAsString());

        if (!entry.getEntryFundingSources().isEmpty()) {
            EntryFundingSource source = entry.getEntryFundingSources().iterator().next();
            info.setPrincipalInvestigator(source.getFundingSource().getPrincipalInvestigator());
            info.setFundingSource(source.getFundingSource().getFundingSource());
        }

        info.setLinks(entry.getLinksAsString());
        ArrayList<ParameterInfo> params = new ArrayList<>();

        if (entry.getParameters() != null) {
            for (Parameter parameter : entry.getParameters()) {
                ParameterInfo paramInfo = new ParameterInfo();
                paramInfo.setName(parameter.getKey());
                paramInfo.setValue(parameter.getValue());
                paramInfo.setType(ParameterType.valueOf(parameter.getParameterType().name()));
                params.add(paramInfo);
            }
        }
        info.setParameters(params);

        // get visibility
        info.setVisibility(Visibility.valueToEnum(entry.getVisibility()));

        String parsed = EntryUtil.getParsedNotes(entry.getLongDescriptionType());
        info.setLongDescription(entry.getLongDescription());
        info.setParsedDescription(parsed);
        if (account != null) {
            String parsedShortDesc = EntryUtil.linkifyText(account, entry.getShortDescription());
            info.setLinkifiedShortDescription(parsedShortDesc);

            String linkStr = "";
            if (entry.getLinks() != null) {
                for (Link link : entry.getLinks()) {
                    if (link.getLink() != null && !link.getLink().isEmpty())
                        linkStr += (link.getLink() + ", ");
                    else if (link.getUrl() != null && !link.getUrl().isEmpty())
                        linkStr += (link.getUrl() + ", ");
                }
                if (!linkStr.isEmpty())
                    linkStr = linkStr.substring(0, linkStr.length() - 1);
            }
            String parsedLinks = EntryUtil.linkifyText(account, linkStr);
            info.setLinkifiedLinks(parsedLinks);
            String parsedReferences = EntryUtil.linkifyText(account, entry.getReferences());
            info.setReferences(parsedReferences);
        }
        return info;
    }

    private static EntryInfo getCommon(Account account, EntryInfo info, Entry entry) {
        info.setId(entry.getId());
        info.setRecordId(entry.getRecordId());
        info.setPartId(EntryUtil.getPartNumbersAsString(entry));
        info.setVersionId(entry.getVersionId());
        info.setName(entry.getNamesAsString());
        info.setOwner(entry.getOwner());
        info.setOwnerEmail(entry.getOwnerEmail());
        info.setCreator(entry.getCreator());
        info.setCreatorEmail(entry.getCreatorEmail());

        AccountController accountController = ControllerFactory.getAccountController();
        try {
            long ownerId = accountController.getAccountId(entry.getOwnerEmail());
            info.setOwnerId(ownerId);
            if (entry.getCreatorEmail() != null) {
                long creatorId = accountController.getAccountId(entry.getCreatorEmail());
                info.setCreatorId(creatorId);
            }
        } catch (ControllerException ce) {
        }

        info.setAlias(entry.getAlias());
        info.setKeywords(entry.getKeywords());
        info.setStatus(entry.getStatus());
        info.setShortDescription(entry.getShortDescription());
        info.setCreationTime(entry.getCreationTime());
        info.setModificationTime(entry.getModificationTime());
        info.setBioSafetyLevel(entry.getBioSafetyLevel());

        info.setLongDescription(entry.getLongDescription());
        info.setLongDescriptionType(entry.getLongDescriptionType());
        info.setIntellectualProperty(entry.getIntellectualProperty());
        info.setSelectionMarkers(entry.getSelectionMarkersAsString());

        if (!entry.getEntryFundingSources().isEmpty()) {
            EntryFundingSource source = entry.getEntryFundingSources().iterator().next();
            info.setPrincipalInvestigator(source.getFundingSource().getPrincipalInvestigator());
            info.setFundingSource(source.getFundingSource().getFundingSource());
        }

        info.setLinks(entry.getLinksAsString());
        ArrayList<ParameterInfo> params = new ArrayList<ParameterInfo>();

        if (entry.getParameters() != null) {
            for (Parameter parameter : entry.getParameters()) {
                ParameterInfo paramInfo = new ParameterInfo();
                paramInfo.setName(parameter.getKey());
                paramInfo.setValue(parameter.getValue());
                paramInfo.setType(ParameterType.valueOf(parameter.getParameterType().name()));
                params.add(paramInfo);
            }
        }
        info.setParameters(params);

        // get visibility
        info.setVisibility(Visibility.valueToEnum(entry.getVisibility()));

        String parsed = EntryUtil.getParsedNotes(entry.getLongDescriptionType());
        info.setLongDescription(entry.getLongDescription());
        info.setParsedDescription(parsed);
        if (account != null) {
            String parsedShortDesc = EntryUtil.linkifyText(account, entry.getShortDescription());
            info.setLinkifiedShortDescription(parsedShortDesc);

            String linkStr = "";
            if (entry.getLinks() != null) {
                for (Link link : entry.getLinks()) {
                    if (link.getLink() != null && !link.getLink().isEmpty())
                        linkStr += (link.getLink() + ", ");
                    else if (link.getUrl() != null && !link.getUrl().isEmpty())
                        linkStr += (link.getUrl() + ", ");
                }
                if (!linkStr.isEmpty())
                    linkStr = linkStr.substring(0, linkStr.length() - 1);
            }
            String parsedLinks = EntryUtil.linkifyText(account, linkStr);
            info.setLinkifiedLinks(parsedLinks);
            String parsedReferences = EntryUtil.linkifyText(account, entry.getReferences());
            info.setReferences(parsedReferences);
        }
        return info;
    }

Replace Generic With Diamond ArrayList<ParameterInfo> with ArrayList<> in method private getCommon(account Account, info EntryInfo, entry Entry) : EntryInfo from class org.jbei.ice.server.ModelToInfoFactory


    /**
     * Filter {@link Entry} id's for display.
     * <p/>
     * Given a List of entry id's, keep only id's that user has read access to.
     *
     * @param ids
     * @return List of Entry ids.
     * @throws ControllerException
     */
    List<Long> filterEntriesByPermission(Account account, List<Long> ids) throws ControllerException {
        ArrayList<Long> result = new ArrayList<>();
        for (Long id : ids) {
            Entry entry;
            try {
                entry = dao.get(id);
            } catch (DAOException e) {
                Logger.error(e);
                continue;
            }

            if (permissionsController.hasReadPermission(account, entry)) {
                result.add(id);
            }
        }
        return result;
    }

    /**
     * Filter {@link Entry} id's for display.
     * <p/>
     * Given a List of entry id's, keep only id's that user has read access to.
     *
     * @param ids
     * @return List of Entry ids.
     * @throws ControllerException
     */
    List<Long> filterEntriesByPermission(Account account, List<Long> ids) throws ControllerException {
        ArrayList<Long> result = new ArrayList<Long>();
        for (Long id : ids) {
            Entry entry;
            try {
                entry = dao.get(id);
            } catch (DAOException e) {
                Logger.error(e);
                continue;
            }

            if (permissionsController.hasReadPermission(account, entry)) {
                result.add(id);
            }
        }
        return result;
    }

Replace Generic With Diamond ArrayList<Long> with ArrayList<> in method package filterEntriesByPermission(account Account, ids List<Long>) : List<Long> from class org.jbei.ice.lib.entry.EntryController


    public ArrayList<Entry> getEntriesByIdSet(Account account, ArrayList<Long> queryResultIds)
            throws ControllerException {
        List<Long> filtered = this.filterEntriesByPermission(account, queryResultIds);
        try {
            ArrayList<Entry> results = new ArrayList<>(dao.getEntriesByIdSet(filtered));
            return results;
        } catch (DAOException e) {
            throw new ControllerException(e);
        }
    }

    public ArrayList<Entry> getEntriesByIdSet(Account account, ArrayList<Long> queryResultIds)
            throws ControllerException {
        List<Long> filtered = this.filterEntriesByPermission(account, queryResultIds);
        try {
            ArrayList<Entry> results = new ArrayList<Entry>(dao.getEntriesByIdSet(filtered));
            return results;
        } catch (DAOException e) {
            throw new ControllerException(e);
        }
    }

Replace Generic With Diamond ArrayList<Entry> with ArrayList<> in method public getEntriesByIdSet(account Account, queryResultIds ArrayList<Long>) : ArrayList<Entry> from class org.jbei.ice.lib.entry.EntryController