Project

General

Profile

« Previous | Next » 

Revision a7cbfd9c

Added by Andreas Müller over 2 years ago

ref #4770 fix clone for AgentBase.contact

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/AgentBase.java
239 239
		getNewOrExistingContact(false).removeUrl(url);
240 240
	}
241 241

  
242
    @Override
243
    public AgentBase<S> clone() throws CloneNotSupportedException {
244
        AgentBase<S> result = (AgentBase<S>)super.clone();
245

  
246
        result.setContact(this.contact == null ? null : this.contact.clone());
247
        //nothing to do: contact
248
        return result;
249
    }
250

  
242 251
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/Contact.java
401 401
	 * @see java.lang.Object#clone()
402 402
	 */
403 403
	@Override
404
	public Object clone() {
404
	public Contact clone() {
405 405
		try{
406 406
			Contact result = (Contact) super.clone();
407 407
			result.addresses = new HashSet<>();
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/TeamOrPersonBase.java
135 135
        return result;
136 136
    }
137 137

  
138
    @Override
139
    public TeamOrPersonBase clone() throws CloneNotSupportedException {
140
        @SuppressWarnings("rawtypes")
141
        TeamOrPersonBase<?> result = (TeamOrPersonBase)super.clone();
142

  
143
        //nothing to do: collectorTitle, nomenclaturalTitle;
144
        return result;
145
    }
138 146
}

Also available in: Unified diff