Fix bug Exception launched when clicking on Edit Task 'Found resources' panel: doesn't implement comparable

FEA: ItEr66OTS08CorreccionsRecursosLimitantesItEr65OTS04
This commit is contained in:
Diego Pino Garcia 2010-12-29 18:07:26 +01:00
parent 4a4e257952
commit 765375425a

View file

@ -32,7 +32,7 @@ import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
* @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
*/
public class Worker extends Resource {
public class Worker extends Resource implements Comparable {
public static Worker create() {
return create(new Worker());
@ -100,7 +100,7 @@ public class Worker extends Resource {
}
public String getDescription() {
return getFirstName()+" "+getSurname();
return getFirstName() + " " + getSurname();
}
@Override
@ -186,4 +186,14 @@ public class Worker extends Resource {
public ResourceEnum getType() {
return type;
}
@Override
public int compareTo(Object arg0) {
if (!(arg0 instanceof Worker)) {
return -1;
}
Worker worker = (Worker) arg0;
return worker.getShortDescription().compareTo(getShortDescription());
}
}