code cleaning
authorKatja Luther <k.luther@bgbm.org>
Mon, 25 Jan 2021 10:19:37 +0000 (11:19 +0100)
committerKatja Luther <k.luther@bgbm.org>
Mon, 25 Jan 2021 10:19:37 +0000 (11:19 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java

index cd07079277bba51b3bf286715945b8780aa3f756..dc0168a4b6ab581612e11aaf9f7340314035f91f 100644 (file)
@@ -66,7 +66,6 @@ import eu.etaxonomy.cdm.io.common.ExportDataWrapper;
 import eu.etaxonomy.cdm.io.common.ExportResult;
 import eu.etaxonomy.cdm.io.common.ExportResultType;
 import eu.etaxonomy.cdm.io.common.ExportType;
-import eu.etaxonomy.cdm.io.common.ImportResult;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -269,7 +268,7 @@ public abstract class AbstractUtility {
                                 feedbackGenerator,
                                 subMonitor);
                     } catch (Exception ex) {
-                        return new Status(Status.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
+                        return new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
                     }
 
                     createExportResult(label, urlString, createZip, remotingMonitor);
@@ -635,7 +634,7 @@ public abstract class AbstractUtility {
                                 feedbackGenerator,
                                 subMonitor);
                     } catch (Exception ex) {
-                        return new Status(Status.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
+                        return new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
                     }
 
                     // collect reports
@@ -696,18 +695,6 @@ public abstract class AbstractUtility {
                     taxaToUpdate.add(taxon);
                 }
             }
-        }else if (remotingMonitor.getResult() instanceof ImportResult){
-            Map<String, Integer> result = ((ImportResult)remotingMonitor.getResult()).getUpdatedRecords();
-            for (Map.Entry<String, Integer> object: result.entrySet()){
-                Taxon taxon = null;
-                if (object instanceof Taxon){
-                    taxon = HibernateProxyHelper.deproxy(object, Taxon.class);
-                }else if (object instanceof Synonym){
-                    Synonym syn = HibernateProxyHelper.deproxy(object, Synonym.class);
-                    taxon = syn.getAcceptedTaxon();
-                }
-                taxaToUpdate.add(taxon);
-           }
         }
         return taxaToUpdate;
     }
index 4732515336d2fcd3935829e9947c4be9ed6148b8..b8980595a32a526d1999a9a3c122706a04a67652 100644 (file)
@@ -233,13 +233,6 @@ public class DescriptionHelper {
                                        "Nom. source for " + sourcedName.getTitleCache();
                                }
 
-//                             if(sourcedObject instanceof IIdentifiableEntity){
-//                                     sourceObjectTitle = ((IdentifiableEntity) sourcedObject).getTitleCache();
-//                             }else if(sourcedObject instanceof DescriptionElementBase){
-//                                     sourceObjectTitle = "Element for description: " + ((DescriptionElementBase) sourcedObject).getInDescription().getTitleCache();
-//                             }else{
-//                                     throw new IllegalStateException("Unknown ISourceable object for given OriginalSourceBase");
-//                             }
 
                                resultString = CdmUtils.concat("; ", new String[]{originalSource.getIdNamespace(), originalSource.getIdInSource(), sourceObjectTitle});
                        }catch(LazyInitializationException e){