cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 6 May 2021 22:27:39 +0000 (00:27 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 6 May 2021 22:27:39 +0000 (00:27 +0200)
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonNodeDaoHibernateImpl.java

index 7523fd4ef746fcaff2ae0f45319ac8293a27be8b..100e9c7006f6d7aee7f7f36847e946263c464811 100755 (executable)
@@ -749,25 +749,26 @@ public class TaxonNodeDaoHibernateImpl extends AnnotatableDaoImpl<TaxonNode>
         return setSecundum(newSec, emptyDetail, queryStr, monitor);\r
     }\r
 \r
-    @SuppressWarnings("unchecked")\r
     private <T extends TaxonBase<?>> Set<T> setSecundum(Reference newSec, boolean emptyDetail, String queryStr, IProgressMonitor monitor) {\r
         Set<T> result = new HashSet<>();\r
         Query query = getSession().createQuery(queryStr);\r
+        @SuppressWarnings("unchecked")\r
         List<List<Integer>> partitionList = splitIdList(query.list(), DEFAULT_SET_SUBTREE_PARTITION_SIZE);\r
         for (List<Integer> taxonIdList : partitionList){\r
-            List<TaxonBase> taxonList = taxonDao.loadList(taxonIdList, null, null);\r
-            for (TaxonBase<?> taxonBase : taxonList){\r
+            @SuppressWarnings("unchecked")\r
+            List<T> taxonList = (List<T>)taxonDao.loadList(taxonIdList, null, null);\r
+            for (T taxonBase : taxonList){\r
                 if (taxonBase != null){\r
                     taxonBase = CdmBase.deproxy(taxonBase);\r
                     if (newSec == null && taxonBase.getSec() !=null\r
                             || newSec != null && (taxonBase.getSec() == null || !newSec.equals(taxonBase.getSec()) )){\r
                         taxonBase.setSec(newSec);\r
-                        result.add((T)taxonBase);\r
+                        result.add(taxonBase);\r
                     }\r
                     if (emptyDetail){\r
                         if (taxonBase.getSecMicroReference() != null){\r
                             taxonBase.setSecMicroReference(null);\r
-                            result.add((T)taxonBase);\r
+                            result.add(taxonBase);\r
                         }\r
                     }\r
 \r