Project

General

Profile

« Previous | Next » 

Revision a4caff94

Added by Andreas Müller over 5 years ago

ref #6362 fix NonViralName occurrence in vaadin

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/presenter/NewTaxonBasePresenter.java
25 25
import eu.etaxonomy.cdm.api.service.ITaxonService;
26 26
import eu.etaxonomy.cdm.api.service.pager.Pager;
27 27
import eu.etaxonomy.cdm.model.common.CdmBase;
28
import eu.etaxonomy.cdm.model.name.NonViralName;
28
import eu.etaxonomy.cdm.model.name.INonViralName;
29 29
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
30 30
import eu.etaxonomy.cdm.model.reference.Reference;
31 31
import eu.etaxonomy.cdm.model.taxon.Classification;
......
81 81
        app = CdmSpringContextHelper.getApplicationConfiguration();
82 82
    }
83 83

  
84
    private boolean checkIfNameExists(NonViralName name) {
84
    private boolean checkIfNameExists(INonViralName nvn) {
85
        TaxonNameBase<?,?> name = TaxonNameBase.castAndDeproxy(nvn);
85 86
        Pager<TaxonNameBase> names = nameService.findByName(name.getClass(),
86 87
                name.getNameCache(),
87 88
                MatchMode.EXACT,
......
99 100
    @Override
100 101
    public IdUuidName newTaxon(String scientificName, Object secRefItemId, UUID classificationUuid) {
101 102
        NonViralNameParserImpl parser = NonViralNameParserImpl.NewInstance();
102
        NonViralName name = parser.parseFullName(scientificName);
103
        INonViralName name = parser.parseFullName(scientificName);
103 104

  
104 105
        if(checkIfNameExists(name)) {
105 106
            throw new IllegalArgumentException("Given name already exists");
......
125 126
    @Override
126 127
    public IdUuidName newSynonym(String scientificName, Object synSecRefItemId, Object accTaxonSecRefItemId, UUID accTaxonUuid) {
127 128
        NonViralNameParserImpl parser = NonViralNameParserImpl.NewInstance();
128
        NonViralName name = parser.parseFullName(scientificName);
129
        INonViralName name = parser.parseFullName(scientificName);
129 130

  
130 131
        if(checkIfNameExists(name)) {
131 132
            throw new IllegalArgumentException("Given name already exists");

Also available in: Unified diff