I have a problem with a code that should order me certain orders according to the delivery date more next until the latest, the code is implemented in a list, which contains all the orders that were received after the date that the user delivers and those are those that must be reordered, it turns out that when executing the method the method is traversed without stopping in the line "while (aux2.getNext ()! = null) {" since, I do not know why they are created infinity aux2 so the list never gets to null therefore never leaves the while mentioned, helpaaaa
public void OrdenarListaEDD(Date fechaUs){
NodoLista aux=head;
NodoLista aux2=head.getNext() ;
while(aux.getNext()!=null){
aux2=head.getNext();
while(aux2.getNext()!=null ){
if(!aux2.getNext().getDato().getFec_ent().before(aux.getNext().getDato().getFec_ent())){
} else {
NodoLista aux3=aux2.getNext();
aux3.setNext(aux.getNext());
aux.setNext(aux3);
aux2.setNext(aux2.getNext().getNext());
}
aux2=aux2.getNext();
}
aux=aux.getNext();
}
}