Regular |
|
Joined: Tue Oct 12, 2004 9:02 am Posts: 66 Location: Italy
|
Sorry,
Something like that throws that exception in some situations:
Set preferred = utente.getNormativeSegnate();
for (int i = 0; i < results.size(); ++i) {
boolean flag = false;
for (Iterator prefs = preferred.iterator(); prefs.hasNext();) {
Preferito p = (Preferito) prefs.next();
Normativa normativa = (Normativa) results.get(i);
if (p.getNormativa().getId().equals(normativa.getId())) {
signed.add("true");
flag = true;
break;
}
}
if (!flag) {
signed.add("false");
}
}
you can see that "Preferito p" contains a field of type Normativa. So when I do p.getNormativa().... i am loading another normativa, that sometimes is already in the session (in the "results list" of Normativa objects).
I don't know how to obtain the comparison in the code without going in to this exception!
|
|