Project

General

Profile

Revision 7c713d7e

ID7c713d7eb2fbe33f6c7e79f95bc80b500d9cb520
Parent e9baa019
Child ac76be67

Added by Andreas Müller over 3 years ago

cleanup

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
414 414
            results = dao.findTaxaByName(clazz, uninomial, infragenericEpithet, specificEpithet, infraspecificEpithet, authorship, rank, pageSize, pageNumber);
415 415
        }
416 416

  
417
        return new DefaultPagerImpl<TaxonBase>(pageNumber, numberOfResults, pageSize, results);
417
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
418 418
    }
419 419

  
420 420
    @Override
......
451 451
        if(numberOfResults > 0) { // no point checking again
452 452
            results = dao.getTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths, TaxonRelationship.Direction.relatedTo);
453 453
        }
454
        return new DefaultPagerImpl<TaxonRelationship>(pageNumber, numberOfResults, pageSize, results);
454
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
455 455
    }
456 456

  
457 457
    @Override
......
473 473
        if(numberOfResults > 0) { // no point checking again
474 474
            results = dao.getTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths, TaxonRelationship.Direction.relatedFrom);
475 475
        }
476
        return new DefaultPagerImpl<TaxonRelationship>(pageNumber, numberOfResults, pageSize, results);
476
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
477 477
    }
478 478

  
479 479
    @Override
......
605 605
            results = dao.getSynonyms(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
606 606
        }
607 607

  
608
        return new DefaultPagerImpl<Synonym>(pageNumber, numberOfResults, pageSize, results);
608
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
609 609
    }
610 610

  
611 611
    @Override
......
650 650
    @Override
651 651
    public List<UuidAndTitleCache<IdentifiableEntity>> findTaxaAndNamesForEditor(IFindTaxaAndNamesConfigurator configurator){
652 652

  
653
        List<UuidAndTitleCache<IdentifiableEntity>> results = new ArrayList<UuidAndTitleCache<IdentifiableEntity>>();
653
        List<UuidAndTitleCache<IdentifiableEntity>> results = new ArrayList<>();
654 654

  
655 655

  
656 656
        if (configurator.isDoSynonyms() || configurator.isDoTaxa() || configurator.isDoNamesWithoutTaxa() || configurator.isDoTaxaByCommonNames()){
......
671 671
        long numberTaxaResults = 0L;
672 672

  
673 673

  
674
        List<String> propertyPath = new ArrayList<String>();
674
        List<String> propertyPath = new ArrayList<>();
675 675
        if(configurator.getTaxonPropertyPath() != null){
676 676
            propertyPath.addAll(configurator.getTaxonPropertyPath());
677 677
        }
......
967 967
            //    	TaxonDescription
968 968
            if (config.isDeleteDescriptions()){
969 969
                Set<TaxonDescription> descriptions = taxon.getDescriptions();
970
                List<TaxonDescription> removeDescriptions = new ArrayList<TaxonDescription>();
970
                List<TaxonDescription> removeDescriptions = new ArrayList<>();
971 971
                for (TaxonDescription desc: descriptions){
972 972
                    //TODO use description delete configurator ?
973 973
                    //FIXME check if description is ALWAYS deletable
......
1023 1023
                    	result.addException(new Exception("The taxon can not be deleted because it is not used in defined classification."));
1024 1024
                    }
1025 1025
                } else if (config.isDeleteInAllClassifications()){
1026
                    List<TaxonNode> nodesList = new ArrayList<TaxonNode>();
1026
                    List<TaxonNode> nodesList = new ArrayList<>();
1027 1027
                    nodesList.addAll(taxon.getTaxonNodes());
1028 1028
                    for (ITaxonTreeNode treeNode: nodesList){
1029 1029
                        TaxonNode taxonNode = (TaxonNode) treeNode;
......
1466 1466
                topDocsResultSet, luceneSearch.getHighlightFields(), dao, idFieldMap, propertyPaths);
1467 1467

  
1468 1468
        int totalHits = topDocsResultSet != null ? topDocsResultSet.totalGroupCount : 0;
1469
        return new DefaultPagerImpl<SearchResult<TaxonBase>>(pageNumber, totalHits, pageSize, searchResults);
1469
        return new DefaultPagerImpl<>(pageNumber, totalHits, pageSize, searchResults);
1470 1470
    }
1471 1471

  
1472 1472
    @Override
......
1496 1496
                topDocsResultSet, luceneSearch.getHighlightFields(), dao, idFieldMap, propertyPaths);
1497 1497

  
1498 1498
        int totalHits = topDocsResultSet != null ? topDocsResultSet.totalGroupCount : 0;
1499
        return new DefaultPagerImpl<SearchResult<TaxonBase>>(pageNumber, totalHits, pageSize, searchResults);
1499
        return new DefaultPagerImpl<>(pageNumber, totalHits, pageSize, searchResults);
1500 1500
    }
1501 1501

  
1502 1502
    /**
......
1637 1637
        List<NamedArea> namedAreaList = null;
1638 1638
        List<PresenceAbsenceTerm>distributionStatusList = null;
1639 1639
        if(namedAreas != null){
1640
            namedAreaList = new ArrayList<NamedArea>(namedAreas.size());
1640
            namedAreaList = new ArrayList<>(namedAreas.size());
1641 1641
            namedAreaList.addAll(namedAreas);
1642 1642
        }
1643 1643
        if(distributionStatus != null){
1644
            distributionStatusList = new ArrayList<PresenceAbsenceTerm>(distributionStatus.size());
1644
            distributionStatusList = new ArrayList<>(distributionStatus.size());
1645 1645
            distributionStatusList.addAll(distributionStatus);
1646 1646
        }
1647 1647

  
......
1666 1666

  
1667 1667
        boolean addDistributionFilter = namedAreas != null && namedAreas.size() > 0;
1668 1668

  
1669
        List<LuceneSearch> luceneSearches = new ArrayList<LuceneSearch>();
1669
        List<LuceneSearch> luceneSearches = new ArrayList<>();
1670 1670
        Map<CdmBaseType, String> idFieldMap = new HashMap<>();
1671 1671

  
1672 1672
        /*
......
1893 1893
                topDocsResultSet, multiSearch.getHighlightFields(), dao, idFieldMap, propertyPaths);
1894 1894

  
1895 1895
        int totalHits = topDocsResultSet != null ? topDocsResultSet.totalGroupCount : 0;
1896
        return new DefaultPagerImpl<SearchResult<TaxonBase>>(pageNumber, totalHits, pageSize, searchResults);
1896
        return new DefaultPagerImpl<>(pageNumber, totalHits, pageSize, searchResults);
1897 1897
    }
1898 1898

  
1899 1899
    /**
......
2014 2014
                topDocsResultSet, luceneSearch.getHighlightFields(), dao, idFieldMap, propertyPaths);
2015 2015

  
2016 2016
        int totalHits = topDocsResultSet != null ? topDocsResultSet.totalGroupCount : 0;
2017
        return new DefaultPagerImpl<SearchResult<TaxonBase>>(pageNumber, totalHits, pageSize, searchResults);
2017
        return new DefaultPagerImpl<>(pageNumber, totalHits, pageSize, searchResults);
2018 2018

  
2019 2019
    }
2020 2020

  
......
2050 2050
                topDocsResultSet, multiSearch.getHighlightFields(), dao, idFieldMap, propertyPaths);
2051 2051

  
2052 2052
        int totalHits = topDocsResultSet != null ? topDocsResultSet.totalGroupCount : 0;
2053
        return new DefaultPagerImpl<SearchResult<TaxonBase>>(pageNumber, totalHits, pageSize, searchResults);
2053
        return new DefaultPagerImpl<>(pageNumber, totalHits, pageSize, searchResults);
2054 2054

  
2055 2055
    }
2056 2056

  
......
2202 2202
        }
2203 2203
        String genusOfTaxon = taxonName.getGenusOrUninomial();
2204 2204
        Set<TaxonNode> nodes = taxon.getTaxonNodes();
2205
        List<String> taxonNames = new ArrayList<String>();
2205
        List<String> taxonNames = new ArrayList<>();
2206 2206

  
2207 2207
        for (TaxonNode node: nodes){
2208 2208
           // Map<String, String> synonymsGenus = new HashMap<>(); // Changed this to be able to store the idInSource to a genusName
......
2225 2225
                        Synonym inferredGenus = null;
2226 2226
                        Synonym potentialCombination = null;
2227 2227

  
2228
                        List<String> propertyPaths = new ArrayList<String>();
2228
                        List<String> propertyPaths = new ArrayList<>();
2229 2229
                        propertyPaths.add("synonym");
2230 2230
                        propertyPaths.add("synonym.name");
2231 2231
                        List<OrderHint> orderHintsSynonyms = new ArrayList<>();
......
3125 3125
        		result.add(new IdentifiedEntityDTO<S>((DefinedTerm)daoObj[0], (String)daoObj[1], (UUID)daoObj[2], (String)daoObj[3], null));
3126 3126
        	}
3127 3127
        }
3128
		return new DefaultPagerImpl<IdentifiedEntityDTO<S>>(pageNumber, numberOfResults, pageSize, result);
3128
		return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, result);
3129 3129
	}
3130 3130

  
3131 3131
	@Override
......
3153 3153
                result.add(new MarkedEntityDTO<S>((MarkerType)daoObj[0], (Boolean)daoObj[1], (UUID)daoObj[2], (String)daoObj[3]));
3154 3154
            }
3155 3155
        }
3156
        return new DefaultPagerImpl<MarkedEntityDTO<S>>(pageNumber, numberOfResults, pageSize, result);
3156
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, result);
3157 3157
    }
3158 3158

  
3159 3159
    @Override

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)