data = ((AnnotationData) list.get(0)).getOwner(); if (userDetails.getId() == id.intValue()) userIndex = index; owners[index] = data.getLastName(); ownersMap.put(new Integer(index), id); index++;
if (list != null || list.size() > 0) { data = ((AnnotationData) list.get(0)).getOwner(); if (userDetails.getId() == id.intValue()) userIndex = index; owners[index] = data.getLastName(); ownersMap.put(new Integer(index), id); index++; }
    void showAnnotations()    {        ExperimenterData userDetails = model.getUserDetails();        if (userDetails == null) return;        Map annotations = model.getAnnotations();        if (annotations == null) return;        String[] owners = new String[annotations.size()];        Iterator i = annotations.keySet().iterator();        Long id;        int index = 0;        ownersMap = new HashMap();        List list;        ExperimenterData data;        while (i.hasNext()) {            id = (Long) i.next();            list = (List) annotations.get(id);            data = ((AnnotationData) list.get(0)).getOwner();            if (userDetails.getId() == id.intValue()) userIndex = index;            owners[index] = data.getLastName();            ownersMap.put(new Integer(index), id);            index++;        }        //No annotation for the current user, so allow creation.        if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex);        setComponentsEnabled(true);        formatUsersList(owners);        annotatedByList.clearSelection();        annotatedByList.setSelectedIndex(userIndex);        showSingleAnnotation();    }