Fix bug Exception launched when clicking on Edit Task 'Found resources' panel: doesn't implement comparable
FEA: ItEr66OTS08CorreccionsRecursosLimitantesItEr65OTS04
This commit is contained in:
parent
4a4e257952
commit
765375425a
1 changed files with 12 additions and 2 deletions
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue