Project

General

Profile

« Previous | Next » 

Revision dd244f30

Added by Katja Luther almost 8 years ago

fix for #5638

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
......
36 36
 * @version 1.0
37 37
 */
38 38
public class ProtologueSection extends AbstractEntityCollectionSection<TaxonNameBase, DescriptionElementBase> implements ITaxonBaseDetailSection{
39
	
39

  
40 40
	private TaxonBase taxonBase;
41 41

  
42 42
	/**
......
97 97
		List<TaxonNameDescription> descriptions = getTaxonNameDescriptions(getEntity());
98 98
		for (TaxonNameDescription desc : descriptions){
99 99
			desc.removeElement(element);
100
		} 
100
		}
101 101
	}
102 102

  
103 103
	/** {@inheritDoc} */
104
	public void setTaxonBase(TaxonBase entity) {
104
	@Override
105
    public void setTaxonBase(TaxonBase entity) {
105 106
		this.taxonBase = entity;
106
		NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName(), NonViralName.class);
107
		NonViralName name = HibernateProxyHelper.deproxy(entity.getName(), NonViralName.class);
107 108
		setEntity(name);
108 109
	}
109
	
110

  
110 111
	/**
111 112
	 * NOTE: returns first description
112 113
	 * @param name
......
118 119
		}
119 120
		return (TaxonNameDescription) name.getDescriptions().iterator().next();
120 121
	}
121
	
122

  
122 123
	/**
123 124
	 * Try to fix FIXME in {@link #getTaxonNameDescription(TaxonNameBase)}
124 125
	 * @param name
......
129 130
		if (name == null){
130 131
			return result;
131 132
		}
132
		if(name.getDescriptions().size() == 0){
133
			name.addDescription(TaxonNameDescription.NewInstance(name));
134
		}
133
//		if(name.getDescriptions().size() == 0){
134
//			name.addDescription(TaxonNameDescription.NewInstance(name));
135
//		}
135 136
		for (TaxonNameDescription desc : name.getDescriptions()){
136 137
			result.add(desc);
137 138
		}

Also available in: Unified diff