Project

General

Profile

Revision 152082b2

ID152082b24330cba4b55244d33a9107ad03fc4c2e
Parent c1d7cb61
Child f1ec80f5

Added by Andreas Müller almost 3 years ago

cleanup

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DeterminationEvent.java
45 45

  
46 46
/**
47 47
 * @author m.doering
48
 * @version 1.0
49 48
 * @created 08-Nov-2007 13:06:21
50 49
 */
51 50
@XmlAccessorType(XmlAccessType.FIELD)
......
106 105
	@XmlSchemaType(name = "IDREF")
107 106
	@ManyToMany(fetch = FetchType.LAZY)
108 107
	@Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
109
	private Set<Reference> setOfReferences = new HashSet<Reference>();
108
	private Set<Reference> setOfReferences = new HashSet<>();
110 109

  
111 110

  
112 111

  
......
251 250
		}
252 251
	}
253 252

  
254

  
255

  
256 253
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
122 122
    public UuidAndTitleCache<TaxonNode> getParentUuidAndTitleCache(ITaxonTreeNode child) {
123 123
        UUID uuid = child.getUuid();
124 124
        int id = child.getId();
125
        UuidAndTitleCache<TaxonNode> uuidAndTitleCache = new UuidAndTitleCache<TaxonNode>(uuid, id, null);
125
        UuidAndTitleCache<TaxonNode> uuidAndTitleCache = new UuidAndTitleCache<>(uuid, id, null);
126 126
        return getParentUuidAndTitleCache(uuidAndTitleCache);
127 127
    }
128 128

  
......
157 157
    public List<UuidAndTitleCache<TaxonNode>> listChildNodesAsUuidAndTitleCache(ITaxonTreeNode parent) {
158 158
        UUID uuid = parent.getUuid();
159 159
        int id = parent.getId();
160
        UuidAndTitleCache<TaxonNode> uuidAndTitleCache = new UuidAndTitleCache<TaxonNode>(uuid, id, null);
160
        UuidAndTitleCache<TaxonNode> uuidAndTitleCache = new UuidAndTitleCache<>(uuid, id, null);
161 161
        return listChildNodesAsUuidAndTitleCache(uuidAndTitleCache);
162 162
    }
163 163

  
......
237 237
        Classification classification = oldTaxonNode.getClassification();
238 238
        Taxon oldTaxon = HibernateProxyHelper.deproxy(oldTaxonNode.getTaxon());
239 239
        Taxon newAcceptedTaxon = (Taxon)this.taxonService.find(newAcceptedTaxonNode.getTaxon().getUuid());
240
        newAcceptedTaxon = HibernateProxyHelper.deproxy(newAcceptedTaxon, Taxon.class);
240
        newAcceptedTaxon = HibernateProxyHelper.deproxy(newAcceptedTaxon);
241 241
        // Move oldTaxon to newTaxon
242 242
        //TaxonName synonymName = oldTaxon.getName();
243 243
        TaxonName newSynonymName = CdmBase.deproxy(oldTaxon.getName());
......
254 254
        TaxonName newAcceptedTaxonName = HibernateProxyHelper.deproxy(newAcceptedTaxon.getName(), TaxonName.class);
255 255
        newAcceptedTaxon.setName(newAcceptedTaxonName);
256 256
        // Move Synonym Relations to new Taxon
257
        Synonym newSynonym = newAcceptedTaxon.addSynonymName(newSynonymName, citation, citationMicroReference,
258
                synonymType);
257
        newAcceptedTaxon.addSynonymName(newSynonymName, citation, citationMicroReference, synonymType);
259 258
         // Move Synonyms to new Taxon
260 259
        // From ticket 3163 we can move taxon with accepted name having homotypic synonyms
261 260
        List<Synonym> synonymsInHomotypicalGroup = null;
......
298 297

  
299 298
        // CHILD NODES
300 299
        if(oldTaxonNode.getChildNodes() != null && oldTaxonNode.getChildNodes().size() != 0){
301
        	List<TaxonNode> childNodes = new ArrayList<TaxonNode>();
300
        	List<TaxonNode> childNodes = new ArrayList<>();
302 301
        	for (TaxonNode childNode : oldTaxonNode.getChildNodes()){
303 302
        		childNodes.add(childNode);
304 303
        	}
......
308 307
        }
309 308

  
310 309
        //Move Taxon RelationShips to new Taxon
311
        Set<TaxonRelationship> obsoleteTaxonRelationships = new HashSet<TaxonRelationship>();
312 310
        for(TaxonRelationship taxonRelationship : oldTaxon.getTaxonRelations()){
313 311
            Taxon fromTaxon = HibernateProxyHelper.deproxy(taxonRelationship.getFromTaxon());
314 312
            Taxon toTaxon = HibernateProxyHelper.deproxy(taxonRelationship.getToTaxon());
......
417 415
        	config = new TaxonDeletionConfigurator();
418 416
        }
419 417
        DeleteResult result = new DeleteResult();
420
        List<UUID> deletedUUIDs = new ArrayList<UUID>();
421 418
        Classification classification = null;
422
        List<TaxonNode> taxonNodes = new ArrayList<TaxonNode>(list);
423
        
419
        List<TaxonNode> taxonNodes = new ArrayList<>(list);
420

  
424 421
        for (TaxonNode treeNode:taxonNodes){
425 422
        	if (treeNode != null){
426 423

  
......
540 537
    @Override
541 538
    @Transactional(readOnly = false)
542 539
    public DeleteResult deleteTaxonNodes(Collection<UUID> nodeUuids, TaxonDeletionConfigurator config) {
543
        List<TaxonNode> nodes = new ArrayList<TaxonNode>();
540
        List<TaxonNode> nodes = new ArrayList<>();
544 541
        for(UUID nodeUuid : nodeUuids) {
545 542
            nodes.add(dao.load(nodeUuid));
546 543
        }
......
653 650
    public UpdateResult moveTaxonNode(TaxonNode taxonNode, TaxonNode newParent, int movingType){
654 651
        UpdateResult result = new UpdateResult();
655 652

  
656
        TaxonNode parentParent = HibernateProxyHelper.deproxy(newParent.getParent(), TaxonNode.class);
657
        TaxonNode oldParent = HibernateProxyHelper.deproxy(taxonNode.getParent(), TaxonNode.class);
653
        TaxonNode parentParent = HibernateProxyHelper.deproxy(newParent.getParent());
654
        TaxonNode oldParent = HibernateProxyHelper.deproxy(taxonNode.getParent());
658 655
        Integer sortIndex = -1;
659 656
        if (movingType == 0){
660 657
            sortIndex = 0;
......
708 705
                    agentUuid, rankUuid, relTypeUuid, PagerUtils.startFor(pageSize, pageIndex), PagerUtils.limitFor(pageSize), propertyPaths);
709 706
        }
710 707

  
711
        Pager<TaxonNodeAgentRelation> pager = new DefaultPagerImpl<TaxonNodeAgentRelation>(pageIndex, count, pageSize, records);
708
        Pager<TaxonNodeAgentRelation> pager = new DefaultPagerImpl<>(pageIndex, count, pageSize, records);
712 709
        return pager;
713 710
    }
714 711

  
......
772 769
    public UpdateResult addTaxonNodeAgentRelation(UUID taxonNodeUUID, UUID agentUUID, DefinedTerm relationshipType){
773 770
        UpdateResult result = new UpdateResult();
774 771
        TaxonNode node = dao.load(taxonNodeUUID);
775
        TeamOrPersonBase agent = (TeamOrPersonBase) agentService.load(agentUUID);
772
        TeamOrPersonBase<?> agent = (TeamOrPersonBase<?>) agentService.load(agentUUID);
776 773
        node.addAgentRelation(relationshipType, agent);
777 774
        try{
778 775
            dao.merge(node, true);
......
912 909
        return uuid;
913 910
    }
914 911

  
915
	
916

  
917

  
918

  
919

  
920 912
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)